Repository navigation
fix(repos): every repo catalog uses the host-catalog fence - #27116
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 The previously reported catalog-loading race is addressed. No actionable merge-blocking issue remains from the reviewed evidence. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
af4f86ae-b513-4e16-851c-2efc79d64486
📥 Commits
Reviewing files that changed from the base of the PR and between 440cde0 and a689667ecb182bb37e302a3fcdbd524c1d832ed8.
📒 Files selected for processing (8)
src/renderer/src/store/host-catalog-fencing.tssrc/renderer/src/store/repos/all-host-repo-catalog-actions.tssrc/renderer/src/store/repos/repo-catalog-actions.tssrc/renderer/src/store/repos/repo-catalog-fencing.tssrc/renderer/src/store/repos/runtime-repo-catalog-actions.tssrc/renderer/src/store/slices/repos-all-hosts-generation.test.tssrc/renderer/src/store/slices/repos-catalog-connection-fence.test.tssrc/renderer/src/store/slices/repos-module-lifetime-coordinators.test.ts
💤 Files with no reviewable changes (1)
- src/renderer/src/store/repos/repo-catalog-fencing.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
a689667 to
ae61000
Compare
The all-host and active-target repo loaders fenced only by fetch generation, so a catalog fetched over a runtime connection that was replaced mid-fetch still overwrote the current one. All three repo loaders now claim the shared host-catalog fence (generation, SSH-state and runtime-connection generations), which replaces the repo-only per-host generation map and the Connect flow's inline checks. A dropped catalog is not an answer, so the all-host load skips repo-scoped UI validation.
Its late claim would void the newer load's in-flight catalog, so neither would apply.
0e59e88 to
5b3cb84
Compare
Upstream @ cc5c85f (386 commits) onto the release line from cce8024 (merge base 1cda323). 102 conflicted paths: both-rewrote 49, modify/delete 20, union 17, duplicate-tail 6, add/add 6, rename-replay 4. The decisions this sync settled are recorded in LOCAL-PATCHES.md § Sync log and local/sync/convergence-ledger.md. Conflict resolutions - The SSH relay removal stands. Upstream deleted src/relay/** and serves SSH hosts from orcad, and the fork's three relay commits did not justify becoming sole maintainer of 467 abandoned files: 36 relay paths resolved to deletion, plus src/shared/ssh-ai-vault-relay.ts and the fork's six src/wsl-guest/ additions (ledger: "SSH relay removal"). - Repo detection takes upstream's generator shape (probeGitRepo and the *Commands helpers), retiring the fork's parallel async copy of repo-detection.ts and repo-git-marker-scan.ts. The four filesystem steps upstream still runs synchronously are recorded as an Open item. - Owner routing moved to runtimeTargetForOwnerEnvironment. Upstream deleted getActiveRuntimeTarget and settingsForRuntimeOwner and added a lint ratchet; RuntimeFileOperationArgs now carries a `target` and RowLessSource no longer admits GlobalSettings, so the fork's remaining callers were migrated. The fork's Jira/Linear files that still read the Active Server setting are registered in config/focus-setting-read-baseline.txt with an Open item. - The fork's repo-catalog connection fence converged onto upstream's host-catalog fence: upstream 63b3f15 (stablyai#27116) is upstream's own fix for the fork's stablyai#20811, replacing claimRepoCatalogGeneration and captureRuntimeRepoCatalogConnectionFence. repo-catalog-fencing.ts, repo-catalog-actions.ts and all-host-repo-catalog-actions.ts are now byte-identical to upstream. The upstream-bound branch fix/repo-catalog-connection-fence is superseded. - The fork's hidden-SSH-host UI (PR #9) is re-homed, not dropped. SshPane.tsx and SshTargetCard.tsx take upstream's post-relay inline shape, with onSetHidden, the hidden badge and SshTargetVisibilityToggle on top, and the "Hidden (N)" section in the fork-only SshTargetList.tsx. SshTargetCardActions.tsx and the duplicate SshTargetServerList.tsx are gone (ledger: "SSH settings pane"). Verification - pnpm tc:node / tc:cli / tc:web exit 0. - pnpm lint: every check passes except audit:code-quality:native, whose five mobile import(no-cycle) warnings reproduce identically at cce8024 and are carried as documented debt in LOCAL-PATCHES.md. - pnpm test --project node-runtime: 11 failed files / 35 failed tests, all in the documented upstream-red agent-session / agent-launch / structured-agent-session class. Ten of them reproduce identically at cce8024 (34 tests). The eleventh, tests/e2e/cross-version-wire/cross-version-agent-session-wire.unit.test.ts, loads its "release-shaped checkout" from git ref HEAD and so compares HEAD against the uncommitted worktree; it is expected to pass once this commit moves HEAD.
ELI5
Orca asks each paired server for its list of projects. If the connection to a server dropped and came back while a request was still out, the answer from the old connection could arrive late and overwrite the fresh list, bringing back stale or moved projects.
What Changed
claimHostCatalogFenceinsrc/renderer/src/store/host-catalog-fencing.ts, now with a'repos'kind). It checks the request generation, the server's SSH-state generation and its connection generation, plus the removed-server tombstone. A dropped answer counts as "no answer", so the all-hosts load does not use it to clean up saved project filters.repo-catalog-fencing.ts(the local-startup settlement and the all-hosts batch generation stay there) and the Connect flow's module-global generation map and inline connection checks. Net about -65 lines.Why
The root cause was a parallel, weaker fence: the repo loaders had their own generation-only check next to a shared fence that already handled replaced connections. Reusing the shared fence fixes every repo loader in one place and removes the duplicate. Loss of contact still preserves rows: a dropped catalog changes nothing, it never removes a host's projects.
Linked Issue
Fixes #20811
Visual Proof
N/A: background catalog fencing; no UI change.
Testing
repos-catalog-connection-fence.test.ts: for the all-hosts, Connect and active-server loaders, a catalog whose server connection was replaced mid-fetch is not applied, and the all-hosts load keeps saved repo filters. The all-hosts and active-server cases fail onorigin/main.repos-all-hosts-generation.test.ts: the two "started before a reconnect" characterization tests that pinned the bug now assert the fresh catalog survives.repos-module-lifetime-coordinators.test.ts: the cross-store case became a same-store case, because fences are per store (the old module-global map was an artifact of the slice split).96 store/app-shell/ipc-event test files green;
pnpm tc:web,oxlint,pnpm run check:code-quality:changed.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
Notes
SSH/paired servers: loss of contact is not treated as absence; nothing is removed when a catalog is dropped. No wire change.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)