Repository navigation
Preserve editor file identity during SSH host conversion - #26593
Conversation
b7b5fb8 to
45a97f3
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📥 CommitsReviewing files that changed from the base of the PR and between 73e92c0a125aec245927e630dcf122eb780b2074 and 35bb09d. 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughWeb-session tab synchronization now resolves mirrored editor files using worktree, runtime environment, mode, and path ownership data. It can retain existing file ownership and share backing files across split tabs. New tests cover ownership, duplicate IDs, previews, drafts, and SSH OrCAD session conversion. CI routes the conversion test to a dedicated Docker lane. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The ownership spec is routed to the Docker conversion lane for changes to each affected production file. No merge-blocking risk was identified in the reviewed changes. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 11 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
There was a problem hiding this comment.
🔇 Additional comments (12)
src/renderer/src/runtime/web-session-existing-tab-index.ts (1)
10-10: LGTM!Also applies to: 49-50
src/renderer/src/runtime/web-session-tabs-sync/mirrored-editor-file-identity.ts (1)
1-117: LGTM!src/renderer/src/runtime/web-session-tabs-sync/tab-builders.ts (1)
12-13: LGTM!Also applies to: 106-150
src/renderer/src/runtime/web-session-tabs-sync/apply-preparation-browser.ts (1)
119-119: LGTM!Also applies to: 138-141, 155-157, 174-174
src/renderer/src/runtime/web-session-tabs-sync-editor-ownership.test.ts (1)
1-230: LGTM!src/renderer/src/runtime/web-session-tabs-sync-snapshot-batch.test.ts (1)
351-352: LGTM!Also applies to: 387-387, 397-397
config/scripts/pr-e2e-source-routing.mjs (1)
17-25: LGTM!config/scripts/ci-e2e-job-selection.mjs (1)
54-54: LGTM!Also applies to: 64-65, 107-108
config/scripts/ci-e2e-job-selection.test.mjs (1)
148-163: LGTM!.github/workflows/e2e.yml (1)
353-354: LGTM!Also applies to: 588-588, 624-624
config/scripts/pr-e2e-docker-lane-contract.test.mjs (1)
1-76: LGTM!tests/e2e/ssh-orcad-editor-ownership.spec.ts (1)
37-64: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Remove the debug store subscription before merge.
The
[editor-records]subscriber logs everyopenFilesmutation. Each log includes a fullError().stackand the complete file and tab records. Lines 82-93 and Line 106 add more diagnosticconsole.logcalls. These logs make CI output noisy and serve no purpose for the assertions. Remove them, or gate them behind an env flag.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
96c9d867-8c19-4715-b3c6-14afaa643729
📒 Files selected for processing (15)
.github/workflows/e2e.ymlconfig/scripts/ci-e2e-job-selection.mjsconfig/scripts/ci-e2e-job-selection.test.mjsconfig/scripts/pr-e2e-docker-lane-contract.test.mjsconfig/scripts/pr-e2e-gate-contract.test.mjsconfig/scripts/pr-e2e-source-routing.mjssrc/renderer/src/runtime/web-session-existing-tab-index.tssrc/renderer/src/runtime/web-session-tabs-sync-editor-ownership.test.tssrc/renderer/src/runtime/web-session-tabs-sync-snapshot-batch.test.tssrc/renderer/src/runtime/web-session-tabs-sync/apply-preparation-browser.tssrc/renderer/src/runtime/web-session-tabs-sync/mirrored-editor-file-identity.tssrc/renderer/src/runtime/web-session-tabs-sync/state-equality-files.tssrc/renderer/src/runtime/web-session-tabs-sync/tab-builders.tssrc/renderer/src/runtime/web-session-tabs-sync/terminal-surfaces.tstests/e2e/ssh-orcad-editor-ownership.spec.ts
💤 Files with no reviewable changes (3)
- src/renderer/src/runtime/web-session-tabs-sync/state-equality-files.ts
- src/renderer/src/runtime/web-session-tabs-sync/terminal-surfaces.ts
- config/scripts/pr-e2e-gate-contract.test.mjs
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
…ersion A file opened over the relay in the current session carries route provenance, so the no-host-evidence check repointed its tab to a fresh clean record and hid the unsaved draft. Keep any retained record with no runtime owner instead.
73e92c0 to
35bb09d
Compare
…h a host pin Since stablyai#26593 the mirror resolver reuses an existing row for the same owner, so a row restored from the profile keeps its owned editor: id when the host's snapshot lands; the bare-path id the spec waited for can no longer appear. The host now pins its tab after the relaunch and the client must show the pin on the tab backed by its restored row. The ids-seen list is reported at failure time instead of being captured empty before polling.
ELI5
After an SSH host becomes a managed server, Orca can keep two internal copies of the same open document behind one visible tab. Keep one file record as its ownership moves to the server.
What Changed
The session mirror now reuses retained editor files while the existing save-quiesce step moves ownership, then keeps the resulting owned file ID on later snapshots. It resolves ordinary files and Markdown previews by workspace, server and mode, and shares one backing file across split tabs. A cached index avoids scanning every open file for each host tab.
The Docker conversion regression is routed to the existing template-building CI lane. Its lane contract is extracted into a separate test file without weakening the existing coverage checks.
Why
The mirror previously assigned a raw path ID, retained the unstamped source file, and appended a server-owned copy with that same ID. The ownership transition then rewrote both. Reusing the file preserves the existing save fence and client draft; merely deleting duplicates afterward would hide the ownership collision and could copy another host’s disk baseline.
Linked Issue
Found while exercising SSH consolidation in #26483. Independent of the other consolidation fixes.
Visual Proof
editor-records-runtime-red.log
editor-records-runtime-green.log
Both versions show one visible tab. The logs establish the internal two-record versus one-record difference; the corrected screenshot also shows the saved remote content restored after a full app restart. No claim of baseline save loss.
Testing
pnpm tc,pnpm lint, changed-code quality, affected-file lint and fresh E2E build pass.Review
Retained file ownership is changed only by the existing quiesced migration. Other owners’ files stay intact; their disk signatures and drafts are not borrowed. Split tabs retain separate tab identities and share one file record. Preview source IDs follow the owned editable document.
Agent skill upstream boundary
Notes
No RPC fields or opcodes change. Workspace keys and host paths remain opaque, so folder workspaces and Windows paths use the same ownership rules. Runtime validation covers macOS client/Linux SSH host; no Windows runtime claim. The separate Markdown metadata routing fix is #26590.
The optional repository-wide E2E typecheck is not enforced yet and reports unrelated existing errors. A focused config for the new spec reports only three errors in unchanged
tests/e2e/helpers/store.ts; the new spec itself has none. Required product typechecks pass.Checklist