Repository navigation
fix(orcad-migration): refuse before fencing a manifest no catalog request can carry - #30836
Conversation
…uest can carry Export accepted manifests up to the 768 KiB validation cap, but every catalog request (stage, state, abort) refuses params over the host's sealed-frame budget, about 1.1 KiB lower. A manifest in that window was journaled and fenced, then every way forward or back refused before sending, leaving the host fenced. Measure the request budget once, in the export module, and check it before the fence and before a delta's journal. Co-Authored-By: Claude <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
…rry can be aborted by its identity A desktop that fenced a manifest just under the export cap before #30836 could never send its abort: every catalog request carries the whole manifest and refuses it before sending. The abort now asks the server by migration id and digest instead (orcad.migration.abortCatalogByReference, behind a new capability), and releases only on the server's durable absent answer. A committed server still refuses the release. Co-authored-by: Claude <[email protected]>
…rry can be aborted by its identity A desktop that fenced a manifest just under the export cap before #30836 could never send its abort: every catalog request carries the whole manifest and refuses it before sending. The abort now asks the server by migration id and digest instead (orcad.migration.abortCatalogByReference, behind a new capability), and releases only on the server's durable absent answer. A committed server still refuses the release. Co-authored-by: Claude <[email protected]>
…y can be cancelled by its id (#30864) * fix(orcad-migration): a source fenced on a manifest no request can carry can be aborted by its identity A desktop that fenced a manifest just under the export cap before #30836 could never send its abort: every catalog request carries the whole manifest and refuses it before sending. The abort now asks the server by migration id and digest instead (orcad.migration.abortCatalogByReference, behind a new capability), and releases only on the server's durable absent answer. A committed server still refuses the release. Co-authored-by: Claude <[email protected]> * test(orcad-migration): cover the durable abort by reference and its RPC method Co-authored-by: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
ELI5
When Orca moves an SSH host's saved projects and tabs to its managed server, it first locks the host and writes down what it is moving. One of its size checks was a little looser than another. A move that landed in the gap got locked in and could never be finished or undone. This PR does the strict check before taking the lock, so such a move is refused up front.
What Changed
Before: two limits disagree by about 1.1 KB:
MAX_ORCAD_MIGRATION_MANIFEST_BYTES).stage,catalogState,abortCatalog) refuses before sending when{ manifest }plus a 1 KiB envelope reserve exceeds the host's sealed-frame budget (fix(ssh): refuse a migration request too large for the host's sealed frame before sending it #30249). That cuts off about 1.1 KiB lower.A manifest in that gap was journaled and the host fenced, then:
The host stayed fenced. The message said "Close tabs … then reconnect", which cannot help while the journal pins the manifest.
After: the budget check runs before the fence and journal are written, and before a delta move's journal. The user gets the same "too large, here are the largest parts" message, quoting the real request limit, and nothing is locked.
Mechanism:
assertOrcadMigrationRequestFits, now holds the request budget, inorcad-migration-manifest-export.tsnext to the existing oversize message.fenceOrcadMigrationSourcecalls it before it journals.runOrcadDeltaMovecalls it for a fresh delta before its terminal check, lease retirement and journal.Why
The check stays out of
createOrcadMigrationManifest. Delta planning, source assertions and preflight build manifests there that are never sent, and a full re-export can legitimately be larger than the delta that actually goes over the wire. The two journal points are the only places a manifest becomes binding, so they are the smallest correct choke point.I did not release a fenced host when the client refuses an oversized request. An older client with a different reserve could have sent the stage, so that refusal is not proof the server holds nothing.
Follow-up (not in this PR): a host fenced in the last two days with a manifest in this ~1.1 KiB window keeps its fence. Releasing it safely needs proof from the server, for example an exact sealed-size check instead of the reserve.
Linked Issue
N/A (found in the post-hardening deficiency scan; regression from #30249).
Visual Proof
N/A: main-process refusal only, no UI change.
Testing
orcad-migration-source-fence.test.ts› "refuses, without a journal or fence, a manifest under the export cap that no request can carry". It fails on main (the fence is taken).orcad-migration-delta-move.test.ts› "refuses, unjournaled, a delta under the export cap that no request can carry". It fails on main (the move proceeds).src/main/ssh/orcad-migration*andorcad-runtime-conversiontest files pass, plus the full static-analysis job locally.AI Disclosure
Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)