Prune missing remote folder from Recently Opened (#319230)#319257
Merged
Conversation
Remote counterpart to the local remove-on-failed-open in WindowsMainService.resolvePath (#74465). At LifecyclePhase.Eventually, the freshly opened workbench stats the current single-folder remote folder URI via the remote file service and prunes from Recently Opened only on authoritative FILE_NOT_FOUND. Transient errors (FILE_OTHER_ERROR / Unavailable) and unregistered providers leave the entry intact.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a workbench contribution to prune stale single-folder remote workspaces from Recently Opened when the remote file service authoritatively reports the folder is missing.
Changes:
- Adds
recentRemoteFolderPrunerto stat the current remote folder atWorkbenchPhase.Eventually. - Registers the contribution in both standard workbench and sessions entry points.
- Adds browser unit coverage for missing, transient-error, no-provider, and local-folder cases.
Show a summary per file
| File | Description |
|---|---|
src/vs/workbench/contrib/workspaces/browser/recentRemoteFolderPruner.ts |
Implements the remote recent-folder pruning contribution. |
src/vs/workbench/contrib/workspaces/test/browser/recentRemoteFolderPruner.test.ts |
Adds unit coverage for pruning and preservation behavior. |
src/vs/workbench/workbench.common.main.ts |
Registers the contribution in the main workbench. |
src/vs/sessions/sessions.common.main.ts |
Registers the contribution in the sessions workbench. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 1
…uning vscode-vfs entries)
… (keep entry points untouched)
hasProvider is sync and the remote provider registers asynchronously via onWillActivateFileSystemProvider, so the earlier short-circuit could permanently skip the prune for the session if the contribution ran before activation. Rely solely on the authoritative FILE_NOT_FOUND filter: any other error (no provider, unavailable, host unreachable) maps to FILE_OTHER_ERROR and leaves the entry intact.
alexr00
approved these changes
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #319230
Fixes #285972
Remote counterpart to the local remove-on-failed-open in
WindowsMainService.resolvePath(#74465). AtWorkbenchPhase.Eventually, the freshly opened workbench stats the current single-foldervscode-remote://folder URI via the remote file service and prunes from Recently Opened only on authoritativeFILE_NOT_FOUND. Transient errors (FILE_OTHER_ERROR/Unavailable) and unregistered providers leave the entry intact. Scoped strictly tovscode-remoteso other authorities (e.g.vscode-vfs) are untouched.