Skip to content

Grace period for inaccessible workspaces#52638

Closed
ojpro wants to merge 7 commits intozed-industries:mainfrom
ojpro:grace-period-for-inaccessible-workspaces
Closed

Grace period for inaccessible workspaces#52638
ojpro wants to merge 7 commits intozed-industries:mainfrom
ojpro:grace-period-for-inaccessible-workspaces

Conversation

@ojpro
Copy link
Copy Markdown
Contributor

@ojpro ojpro commented Mar 28, 2026

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Closes #49603

Release Notes:

  • hide missing workspaces from the picker if it does not exist and within the 7-day grace period, and delete after the grace period

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 28, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from a team, benbrandt and osyvokon and removed request for a team March 28, 2026 21:42
if has_wsl_path || Utc::now() - timestamp >= chrono::Duration::days(7) {
delete_tasks.push(self.delete_workspace_by_id(id));
} else if Self::all_paths_exist_with_a_directory(paths.paths(), fs, None).await {
result.push((id, SerializedWorkspaceLocation::Local, paths, timestamp));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think we'd want to check if the paths exists first, before possibly deleting them. This seems like it will delete things even if they exist.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I forgot to take that into consideration in this condition.

I will fix it soon.

@injust
Copy link
Copy Markdown
Contributor

injust commented Apr 2, 2026

Note that recent projects appear on the "Welcome back to Zed" screen, not just in the project picker.

Currently, projects that were deleted on disk still appear in both places.

ojpro added 2 commits April 3, 2026 16:09
- from recent projects picker
- from welcome screen
- delete after 7 days from the last access
@ojpro
Copy link
Copy Markdown
Contributor Author

ojpro commented Apr 3, 2026

Hey @maxbrunsfeld, @injust

I have fixed the logic to only show projects on the picker/welcome if still exist, and only delete after 7 days from last access

@ojpro
Copy link
Copy Markdown
Contributor Author

ojpro commented Apr 3, 2026

Note that recent projects appear on the "Welcome back to Zed" screen, not just in the project picker.

Currently, projects that were deleted on disk still appear in both places.

@injust for the welcome screen, I tested, and it only updates after re-open (I think)

@maxbrunsfeld
Copy link
Copy Markdown
Collaborator

maxbrunsfeld commented Apr 10, 2026

I pushed an additional commit to this branch and opened another PR #53662

maxbrunsfeld added a commit that referenced this pull request Apr 10, 2026
…ng them for a one week grace period (#53662)

Fixes a regression introduced in
#49603
Supersedes #52638

We want to leave these non-existent workspaces in the database for up to
7 days, in case they are on external drives that are restored later, but
we do *not* want to show them in the UI if they don't exist.

Release Notes:

- Fixed an issue where deleted folders appeared in the recent project
picker

---------

Co-authored-by: ojpro <contact@ojpro.me>
maxbrunsfeld added a commit that referenced this pull request Apr 10, 2026
…ng them for a one week grace period (#53662)

Fixes a regression introduced in
#49603
Supersedes #52638

We want to leave these non-existent workspaces in the database for up to
7 days, in case they are on external drives that are restored later, but
we do *not* want to show them in the UI if they don't exist.

Release Notes:

- Fixed an issue where deleted folders appeared in the recent project
picker

---------

Co-authored-by: ojpro <contact@ojpro.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent deletion of inaccessible project

4 participants