Repository navigation
fix(ssh): link a folder workspace the server kept when a re-created SSH host moves again (#27285) - #30017
Conversation
…e instead of conflicting (#27285)
…folder lease owners
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
ELI5
When you delete an SSH host in Orca and add it back, Orca gives it a new internal id. The next time you move that host onto its managed server, the server may still hold the projects and folder workspaces from the first move. Projects were already recognised as "the same thing the server already has" (#29586), but folder workspaces were not: the server refused the move with
orcad_migration_folder_workspace_id_conflictas soon as the desktop's copy of a folder workspace differed in any way (a comment, an unread flag, its last-activity time). This PR makes folder workspaces follow the same rule as projects.What Changed
Before: delete and re-add an SSH host that was moved once, use a folder workspace on it, then reconnect. The move fails with
orcad_migration_stage_failed:orcad_migration_folder_workspace_id_conflict:<id>and keeps failing on every retry.After: the move goes through. The server keeps its own copy of the folder workspace, which is newer because it has been in use there. This desktop's copy stays in its retained rows, as linked projects' copies already do, so a downgraded build still has it. The connect's "left behind on this desktop" list now names linked folder workspaces next to linked projects.
Mechanism:
repo.list) and links any it already holds. It now also reads the server's folder workspaces and project groups (folderWorkspace.list,projectGroup.list, both existing methods) and links a folder workspace only when the server holds the same id at the same folder and, using the existingresolveFolderWorkspaceHostresolver over the server's catalog, that folder is on the server's own machine. Anything else under that id (a different folder, or a folder the server reaches on another host) is still sent and still refused, so two different folders are never quietly merged.linkedFolderWorkspaceIdsfield next tolinkedRepositoryIds. The relinked manifest leaves them and their saved state out, and later delta moves never offer them again.folder:<id>lease keys, so a bridged terminal in a linked folder blocks the link (naming the folder) and a terminal in a folder that is still moving no longer blocks it.resolveFolderWorkspaceHostnow accepts the narrower row shape a wire read returns. The types are widened only; its behaviour is unchanged.About the report itself: the reporter's later error,
orcad_migration_dormant_id_conflict:worktree_meta:<repo>::<path>, came from a desktop build (1.4.227 or earlier) that didn't yet have #29586. I reproduced it against a real orcad with same-id linking off, and current main already links that project and its saved state (see Testing). This PR closes the remaining folder-workspace version of the same failure.Why
The server's copy of a row it already imported has been in live use since then, so it's the authoritative one. Re-importing over it would lose those edits, and refusing leaves the host stuck. Linking matches what #29586 already does for projects and groups, reuses the same journal, view and delta subtraction, and needs no new wire method: the desktop only calls list methods every migration-capable orcad already serves. Alternatives considered:
Linked Issue
Fixes #27285
Visual Proof
N/A: no UI change. The existing connect notice gains folder entries in its list.
Testing
orcad-migration-repository-link.test.ts):dormant_id_conflict:worktree_metaerror.folder_workspace_id_conflict. After, it converts, the server keeps its own copy, the journal recordslinkedFolderWorkspaceIds, and the connect names the folder.linked_project_terminals:<folder>.orcad-migration-catalog-client.test.ts: the server folder catalog read.0.1.0+379585478820, Oct 16) and its bundled Node into/tmp, ran it with a throwaway HOME,ORCA_USER_DATAand XDG directories on a free port, and reached it through a privatessh -Ltunnel. Against it, real desktop Stores and the real catalog client did a first move, deleted and re-created the target, edited it, then moved again:orcad_migration_stage_failed:orcad_migration_dormant_id_conflict:worktree_meta:.... With main's linking:converted.orcad_migration_stage_failed:orcad_migration_folder_workspace_id_conflict:.... Retrying the same fenced move with this PR:converted, and the server still lists the folder at its original path.Notes