Repository navigation
fix(runtime): refresh open clients after project setup changes - #26941
Conversation
|
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 reported checks passed, and no concrete new blocker is established. The acknowledged reader issues remain outside the claimed disappearance behavior. Pre-merge checks |
|
… scans Runtime setup create/update/delete changed the store without telling open clients, and a path/kind change or deletion left cached worktree scans answering for the old registration. Publish reposChanged after each successful mutation and run the shared worktree-change invalidators on path/kind changes and deletes. Fixes #26562
513738a to
6310665
Compare
ELI5
When a project's setup is created, renamed, moved, switched between Git and folder mode, or deleted through the Orca CLI or a paired client, open Orca windows now refresh right away instead of showing the old project until a reload.
What Changed
Before: the runtime's project-setup create, update, and delete calls wrote the change to the store and returned. Nothing told open desktop windows or paired clients, so the sidebar kept the old name/rows. If the setup's folder path or Git/folder kind changed, or the setup was deleted, cached worktree scans for that repository kept answering with the old rows.
After: every successful create, update, or delete sends the existing "repos changed" event, which the desktop window and paired clients already listen for. Path changes, kind changes, and deletes also run the existing shared worktree-change invalidators for that repository (the runtime scan cache, the desktop scan cache, and the sparse-checkout cache) and clear the cached folder-access roots. Those invalidators already bump a generation, so a scan that was in flight when the change landed cannot write its old result back.
Why
This reuses the event and the invalidation hook that other repository edits already use, so there is no new event type, RPC field, or remote protocol change; older clients behave exactly as before. A rename only needs a refresh, so it does not throw away scan caches. An earlier version of this PR also added a per-row ownership index and extra fleet-listing rechecks (about 1,800 lines); with the shared invalidators already fencing in-flight scans, that machinery was not needed, so this rebuild keeps only the root fix.
Linked Issue
Fixes #26562
Adapts the publication idea from #26564.
Visual Proof
N/A — no UI code changed; the existing sidebar refresh now receives an event it was previously missing.
Testing
src/main/runtime/runtime-project-host-setup-publication.test.tsfails on current main (5/5) and passes with this change: create/update/delete publish, path and kind changes and deletes retire cached scans, and a rename does not. Existing setup controller, delete-guard, and full runtime suites pass.pnpm tc,pnpm lint, and the changed-code quality gate pass.Review
Independent read-only review found no P0/P1 issues (notification loops, SSH host scoping, folder workspaces, wire compatibility).
Agent skill upstream boundary
Notes
SSH: cache retirement runs no Git or filesystem work and changes no host routing; it may refresh a same-id repository's cache on another host, which only costs a rescan. Folder workspaces keep their existing resolution path. No platform-specific code.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)