Repository navigation
fix: save editor-only host sessions during quit - #26848
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
📥 Commits
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 This fix lets sessions that contain only editor tabs save during quit or update restart. No actionable merge-blocking risk was identified. Pre-merge checks |
|
Records the retained adapted contribution from #25925 in replacement PR #26848. Co-authored-by: Sangin <[email protected]>
5c3a7df to
8999f2f
Compare
Normalize the incoming host slice and the saved partition before retirement and membership rebasing read their terminal maps. Fixes #25924
8999f2f to
a246a70
Compare
ELI5
If a remote or paired computer had only file tabs open in Orca (no terminals), quitting or restarting to update could fail to save Orca's state. Now it saves normally.
What Changed
Before: on quit, Orca saves each computer's open tabs separately. For a computer with no terminal tabs, the app leaves the terminal lists out entirely. The save code then tried to read those missing lists while reconciling terminal history and crashed with
Cannot convert undefined or null to object, so the quit save failed.After: the save step for a remote/paired computer fills in empty terminal lists — for both the incoming tabs and any older saved copy that lacks them — before anything reads them. It reuses the existing
withRequiredWorkspaceSessionMapshelper, which was already applied, but only at the very end of the save.Why
Filling the lists in at the start of the one shared save function covers every caller (quit save, normal save) and older saved data, instead of patching each place that reads them. Every later step already treated a missing list as empty, so this changes no other behavior: live terminal tabs that the incoming tabs leave out are still kept by the existing stale-write protection (covered by a test).
Linked Issue
Fixes #25924
Thanks to @silee9019 for the report and original fix in #25925; this applies the fix earlier, so the older-saved-data path is covered too.
Visual Proof
N/A — no visible UI change; this is a save-on-quit failure in the main process.
Testing
New
store-host-partition-before-unload.test.ts(5 cases: empty and non-empty terminal history, folder workspace, older saved copy missing the lists, live terminals kept). All 5 fail onmainwith the reported error and pass with the fix. Persistence store, close-fence, retirement, membership, and shutdown suites pass (408 tests).pnpm tc,pnpm lint, oxlint, and the changed-code quality gate pass. No platform-specific code; SSH hosts use the same save path and are covered by the tests'ssh:host.Review
Self-review and an independent read-only review: no P0/P1 findings.
Agent skill upstream boundary
Notes
No wire or storage format change; older saved data is read and repaired in place.
Checklist
N/Afor visual proof with reasonpnpm lint,pnpm typecheck, focusedpnpm testpass