Skip to content

Prune missing remote folder from Recently Opened (#319230)#319257

Merged
dmitrivMS merged 9 commits into
mainfrom
dev/dmitriv/recent-remote-prune
Jun 4, 2026
Merged

Prune missing remote folder from Recently Opened (#319230)#319257
dmitrivMS merged 9 commits into
mainfrom
dev/dmitriv/recent-remote-prune

Conversation

@dmitrivMS
Copy link
Copy Markdown
Contributor

@dmitrivMS dmitrivMS commented Jun 1, 2026

Fixes #319230
Fixes #285972

Remote counterpart to the local remove-on-failed-open in WindowsMainService.resolvePath (#74465). At WorkbenchPhase.Eventually, the freshly opened workbench stats the current single-folder vscode-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. Scoped strictly to vscode-remote so other authorities (e.g. vscode-vfs) are untouched.

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.
Copilot AI review requested due to automatic review settings June 1, 2026 04:32
@dmitrivMS dmitrivMS added remote Remote system operations issues workbench-history History item issues labels Jun 1, 2026
@dmitrivMS dmitrivMS self-assigned this Jun 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 recentRemoteFolderPruner to stat the current remote folder at WorkbenchPhase.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

Comment thread src/vs/workbench/contrib/workspaces/browser/recentRemoteFolderPruner.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 1

Comment thread src/vs/workbench/contrib/workspaces/browser/recentRemoteFolderPruner.ts Outdated
dmitrivMS added 3 commits May 31, 2026 21:55
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.
@dmitrivMS dmitrivMS requested a review from Copilot June 1, 2026 04:59
@dmitrivMS dmitrivMS added the WSL Issue when using WSL label Jun 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 4

Comment thread src/vs/workbench/contrib/workspaces/test/browser/recentRemoteFolderPruner.test.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new

@dmitrivMS dmitrivMS marked this pull request as ready for review June 4, 2026 09:21
@dmitrivMS dmitrivMS enabled auto-merge (squash) June 4, 2026 09:21
@dmitrivMS dmitrivMS merged commit 78f3a9a into main Jun 4, 2026
47 checks passed
@dmitrivMS dmitrivMS deleted the dev/dmitriv/recent-remote-prune branch June 4, 2026 10:12
@vs-code-engineering vs-code-engineering Bot added this to the 1.124.0 milestone Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

remote Remote system operations issues workbench-history History item issues WSL Issue when using WSL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recently Opened: deleted remote (WSL/SSH) folders are never removed from the list Directory from last WSL install

3 participants