Repository navigation
fix(layout-owner): an unsaved editor draft survives conversion to a managed server (C5-L310) - #52238
Merged
Merged
Conversation
Restores the ssh-orcad journeys (cut 11-21) into the layout-owner suite, passes the server setting to the Docker host's orcad through sshd, and checks the orcad took it.
…er-ssh-orcad-lane # Conflicts: # .github/workflows/layout-owner-switch-on.yml
The nohup launch backgrounds its whole && chain, so the PID removal added in #51342 ran in the background and could delete the PID file the foreground had just written. The host's server then read as unverifiable and connect failed. Remove the old PID before the chain instead.
… and both-mode drift
…d setup-script prompt
…o layout-owner-c5-l310-draft
…anaged server (C5-L310) A server's frames name its files by the server-owned id. A window file restored from before the server (no owner yet) was replaced by the frame's file under that id, leaving its draft under the old id, so the editor showed the disk text. Before a server workspace gates to frames, the window now re-owns such files through the existing restored-owner migration (drafts, buffers and the save gate move with them), holding the gate while the server's worktree route is still unknown.
[Medium impact] The PR appears safe to merge, with no actionable new issues found. SummaryThe PR moves restored editor files, including their drafts, to the server’s file IDs before server frames take over the workspace.
No actionable new issues were found. No previous review threads were supplied. Checks were based on code inspection; tests were not run.
|
…er-c5-l310-draft # Conflicts: # .github/workflows/layout-owner-switch-on.yml # src/main/managed-server/install/orcad-remote-empty-markers.integration.test.ts # tests/layout-owner-e2e/helpers/docker-ssh-host-target.ts # tests/layout-owner-e2e/helpers/orcad-convert-flow.ts # tests/layout-owner-e2e/helpers/orcad-managed-workspace.ts # tests/layout-owner-e2e/helpers/ssh-config-host-picker.ts # tests/layout-owner-e2e/helpers/ssh-remote-only-browser-fixture.ts # tests/layout-owner-e2e/ssh-orcad-browser-drop-owner.spec.ts # tests/layout-owner-e2e/ssh-orcad-browser-routing.spec.ts # tests/layout-owner-e2e/ssh-orcad-browser-service-status.spec.ts # tests/layout-owner-e2e/ssh-orcad-codex-question-skip.spec.ts # tests/layout-owner-e2e/ssh-orcad-desktop-browser-bridge.spec.ts # tests/layout-owner-e2e/ssh-orcad-editor-drafts-migration.spec.ts # tests/layout-owner-e2e/ssh-orcad-explorer-selected-host.spec.ts # tests/layout-owner-e2e/ssh-orcad-idle-exit.spec.ts # tests/layout-owner-e2e/ssh-orcad-pairing-repair.spec.ts # tests/layout-owner-e2e/ssh-orcad-shared-home-machines.spec.ts # tests/layout-owner-e2e/ssh-orcad-shared-login-migration.spec.ts # tests/layout-owner-e2e/ssh-orcad-sleep-disconnected.spec.ts # tests/layout-owner-e2e/ssh-orcad-terminal-browser-link.spec.ts # tests/layout-owner-e2e/ssh-orcad-terminal-journeys.spec.ts # tests/layout-owner-e2e/ssh-orcad-terminal-network-outage.spec.ts # tests/layout-owner-e2e/ssh-orcad-terminal-reconnect-idle-frame.spec.ts # tests/layout-owner-e2e/ssh-orcad-terminal-root-owner.spec.ts # tests/layout-owner-e2e/ssh-orcad-unbindable-tunnel-port.spec.ts # tests/layout-owner-e2e/ssh-orcad-update-anyway.spec.ts # tests/layout-owner-e2e/ssh-orcad-workspace-tools.spec.ts
…le, coalesce, and cover SSH-era files - The re-own clears the pending-owner pause on every view of the shared record, not only the moved one, so a sibling workspace's view stays saveable and a shared draft rejoins instead of splitting. - Concurrent re-owns of one file (editor load and server gate) share one migration instead of the second reading as stale and holding the workspace on the mirror. - The gate re-asks when folder workspaces change, and when a held workspace's open files change. - Files opened over the converted SSH host's relay route are re-owned too, as the switch-off mirror keeps them.
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
With the new layout path on, an unsaved editor draft disappeared when an SSH host was converted to a managed Orca server: the tab showed the file's disk text instead. Now the draft survives conversion, reconnect and restart, as it does with the switch off.
Census row: C5-L310. Two files: the fix, and the spec with its C5-L310 forgiveness removed.
Before / after
editor:<workspace>:<server>:<path>), while the draft stayed under the old id (the bare path). The tab was clean and showed disk text. Bothssh-orcad-editor-drafts-migrationspecs failed (CI run 46215992851 and locally).Mechanism
migrateRestoredEditorFileOwner, which moves the draft, buffers and save gate along with it.server-layout-editor-handover.ts): the gate check that already hands desktop-only tabs to the server now re-owns these restored files first, using the same migration. While the server's worktree route is still unknown (the worktree list arrives after the stream), the workspace stays on the mirror, and the existing routing-change re-check gates it later. If a migration fails and the file is still unowned, the workspace stays on the mirror for this stream, as a refused hand-over already does.How it was tested
CI Actions may be down, so this was verified locally in Docker (arm64 host image, linux-arm64-glibc orcad template built in a container):
ORCA_LAYOUT_OWNER=main,ORCA_SERVER_LAYOUT_OWNER=main): both specs--repeat-each=3, plus a store probe with a 2 MB draft ×3. 9/9 passed. The first fix only re-owned files whose route was known and still lost the 2 MB draft 3 times out of 4. The probe showed the route arriving after the first gate check, which is why the gate now holds.pnpm run typecheck:ciandpnpm check:changed(base layout-owner-v2) pass.ssh-orcad-browser-drop-ownerpass with this change, andbrowser-drop-owneralso passes without it. The first CI run's other ssh failures were terminal-typing specs (the C5-L312 race) and the pre-merge lane copy ofbrowser-drop-owner; none of them open editor files.ssh-orcad-editor-drafts-migrationspec, now unmarked, fails without this fix (data loss, so it stays committed). No unit test was added: this path calls the app-global store's migration, and a unit test would only check wiring.Visible changes
Bug fix only: with the switch on, a converted host's unsaved draft now shows (it used to show disk text). No change with the switch off.
Performance
None measurable, because the gate check adds one scan of the window's open files per server workspace, only while that workspace is not yet gated, and re-owns run once per restored file.