Repository navigation
fix(ssh): move the open workspace to the server's linked project when joining an existing server - #30189
Merged
Conversation
… joining an existing server
… a linked workspace
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
8 of 9 tasks
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.
ELI5
When your Orca joins a managed server that another desktop on the same login already runs, a project both desktops added is linked to the server's copy. The server's copy has its own id. Orca used to move your open workspace onto the server only when the ids matched, so for a linked project it never moved. The workspace kept pointing at the old SSH connection until you clicked it again yourself. Now Orca follows the link and opens the server's copy.
What Changed
ssh:<host>under B's old id, so its panes keep dialling the retired relay.runtime:<server>, the server's id), and the active project follows it. If the server has no project for the workspace at all, nothing is selected rather than leaving a dead target.Mechanism, in
ssh-managed-server-state-effects.ts:linked, the paths of the projects linked during the move. Before the old rows are dropped, the catalog load maps each linked source project to the server project at the same normalized path (normalizeRuntimePathForComparison, the rule the link itself uses).rehomeActiveWorkspaceresolves the server's copy in this order: the same id (unchanged behaviour), then the same checkout path in the linked server project. It checks visible and detected rows, so a checkout the server's visibility settings hide still counts.activeRepoIdfollows the new row instead of keeping the removed source id.throwOnErrorbefore this runs. If the project exists but its checkout row is still missing, for example because startup's scan has not run yet or the server's scan failed, the selection is kept and the effect watches for the row. This generalizes the cold-start retry from fix(ssh): move the open workspace to its managed server after the cold-start scan #29894.Why
fetchWorktreesswallows RPC failures, and startup marks its scan complete even when one host fails. So only project-level absence clears the selection.No wire change:
linkedalready reaches the renderer.Linked Issue
Reviewer P2 on #28886 and #29894 (no GitHub issue).
Visual Proof
N/A: the change is to workspace selection state, asserted directly in the tests.
Testing
ssh-managed-server-converted-catalogs.test.tsdrive the real effect against the real store:ssh:ssh-1)src/renderer/src/hooks/ipc-events(36 files, 238 tests) single-worker,pnpm tc, and every step of the static-analysis job locally. The--compiler=buntypecheck variant doesn't run on this Mac, sopnpm tcstood in for it.Review
Codex review (
gpt-6.1-sol, high), three rounds:activeRepoIdstayed on the removed source project, and a checkout the server only detects was missed.Agent skill upstream boundary
Notes
Renderer-only. SSH and folder workspaces were considered: folder links keep the same id, so the existing same-id lookup covers them. Paths are compared with the cross-platform rule. No mobile or compatibility impact.
Checklist
N/Awith reason for visuals