Repository navigation
refactor(renderer): fold activation mirroring and sort-order persistence off the deprecated owner resolver - #30484
Conversation
…nce off the deprecated owner resolver The eight mirroring callers (#23-#30) read the owner through runtimeEnvironmentIdWithLegacyFallbackUnlessTwin, so a twin is still not mirrored. Sort-order persistence (#2) leaves out ids that two hosts publish, and ids whose only server proof is a repo row (isUnprovenServerSshRoute), instead of writing them to this desktop's or a guessed server's meta. Deprecated importers 40 -> 31.
651ebfd to
4367113
Compare
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 7 minutes. View limit details
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 |
|
Codex (gpt-6.1-sol, high): no findings (reviewed against the F2 branch; the rebase onto main left the diff unchanged). pr.yml 39191606808 success and ssh-orcad Docker lane 39191605424 (Docker 1/2, 2/2) success on the exact head 4367113. Local static job: 0 failures on that head. Units: 1,484 files single-worker. |
ELI5
When you switch tabs or workspaces, Orca tells the paired server that owns the workspace so other windows follow along, and when you reorder the sidebar it saves the order on each owner. Those nine places asked an old "which server owns this?" helper that is being retired. They now ask the replacement. The sort-order save also stops writing ids it cannot place to a guessed host.
What Changed
runtimeEnvironmentIdWithLegacyFallbackUnlessTwin. A workspace two hosts publish is still not mirrored, as before; only the deliberate rows of the round-3 acceptance table change (folder twins and rival servers are not mirrored to the focused server, and a worktree whose only repo row is a server proxying its SSH target mirrors through that server).splitWorktreeSortOrderByHostreadsresolveOwnerWithLegacyFallbackand leaves an id out of every host's write whenisUnprovenServerSshRoute, new inresolve-owner.ts): the worktree row saysssh:Xbut names no server, while a server's repo row proxies anXin its own namespace, which may be a different machine (before: written to this desktop's meta).isUnprovenServerSshRouteis the shared check the round-3 design (§4, case C) names for host writes; F7 reuses it for file writes.worktree-sort-order-persistence.ts+1, annotated. Its split helper calls the legacy-fallback adapter directly, which the ratchet now counts (refactor(renderer): fold 13 sidebar, hook and chat readers off the deprecated owner resolver, and count the adapter as a focus read #30478); F8 removes the legacy branch.Stacked on #30478.
Why
Mirroring is a best-effort notification; "no server" for a twin was already the old answer and stays the safe one. Sort order is a write to a host's metadata, so the design says a twin or an unproven server route refuses rather than guessing; leaving the id out loses only its saved position, while writing it to the wrong host pollutes that host's metadata.
Linked Issue
Round 3 of the SSH/remote hardening (S6(b) F4). No single issue.
Visual Proof
N/A: no UI change; ownership routing only.
Testing
New: sort-order split leaves out a twin and a stale-server-stamp row, and keeps a properly stamped server-nested row (fails before).
pnpm testsingle worker oversrc/renderer/src/lib,components/tab-group,components/tab-bar,store/slices/tabs,runtime,components/sidebar.Full local copy of the pr.yml static job.
ssh-orcad Docker lane dispatched on the exact head (link in a comment).
Live verification: unit-tested only.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Codex (
gpt-6.1-sol, high): see comment.Agent skill upstream boundary
Notes
SSH: only the twin, rival-server and stale-server-stamp rows change. Wire: none (same
worktree.persistSortOrdercalls, fewer ids for unplaceable rows). Cross-platform: none.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)