Repository navigation
Remove a paired computer's deleted projects from every connected device - #12215
Conversation
…nnected device A project deleted on a paired Orca host stayed in every connected client's sidebar and could not be removed there. Two independent defects: 1. Host-local repo IPC mutations only sent `repos:changed` to the host's own renderer (src/main/ipc/repos.ts:2711). The runtime client-event stream was fed only by mutations arriving over runtime RPC, and clients refetch a remote catalog only on a `reposChanged` event -- there is no polling on desktop -- so the deleted rows persisted indefinitely. The shared `notifyReposChanged` helper now also calls the new `OrcaRuntimeService.notifyReposChangedForRemoteClients()` (src/main/runtime/orca-runtime.ts:5175), mirroring the existing `notifyWorktreesChangedForRemoteClients` precedent. This covers every repo, project-group and folder-workspace IPC mutation, so renames, colors, reorders and adds propagate too. 2. Deleting the ghost row on the client routed `repo.rm` to the owner, which answered `repo_not_found`. `removeProject` wrapped its whole body in one try/catch, so the rejection aborted the local purge before the `set()` (src/renderer/src/store/slices/repos.ts:3466) and the delete button appeared to do nothing. Only `repo_not_found` is now tolerated; any other failure still keeps the row, and an opt-in `errorFeedback: 'toast'` makes it visible at the three single-project user-initiated entry points. Bulk and background callers keep today's silence plus their own aggregate reporting. Closes #11994 Co-authored-by: Orca <[email protected]>
|
Warning Review limit reached
Next review available in: 1 minute You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe changes add remote-client 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5b8412fe-73a3-4d62-8c84-4ecd6c97c1e8
📒 Files selected for processing (14)
mobile/src/worktree/host-worktree-refresh.tssrc/main/ipc/repos-remote-client-events.test.tssrc/main/ipc/repos.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/main/window/attach-main-window-services.test.tssrc/main/window/attach-main-window-services.tssrc/renderer/src/components/settings/RepositoryPane.tsxsrc/renderer/src/components/settings/settings-project-list.test.tssrc/renderer/src/components/settings/settings-project-list.tssrc/renderer/src/components/sidebar/RemoveFolderDialog.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/store/slices/repos-remove-missing-remote-project.test.tssrc/renderer/src/store/slices/repos.ts
The settings pane's only render site drops the argument; the toast is already delivered by removeSettingsProjectFromAllHosts. Co-authored-by: Orca <[email protected]>
Cover the cross-host collisions #11994's broadcast now fans out to every paired device. Same-name projects on different hosts were already isolated (per-host UUIDs, host-scoped catalog merge and purge) and are pinned by regression tests. Two same-repo-id paths were not: `repo.rm` with a `path:`/`name:` selector and `deleteProjectHostSetup` both resolved one row and then deleted by bare id, taking the sibling host's registration with it. Co-authored-by: Orca <[email protected]>
Collision edge cases (requested before merge)Checked each case against the code first, then pinned it. Commit fb0feef. 1. Same project name on a local host and a remote — already correct. 2. Same name on multiple remotes — already correct. Same mechanism, per environment. Added: delete on env-A leaves env-B row (success path and the 3. Same repo id on two execution hosts — two real defects, both fixed here.
New tests (each verified to fail without its fix, and the regression pins verified by mutating the host scoping in
Known remaining gap (not introduced here, not fixed here): repo-derived project host setups reuse the repo id as the setup id ( |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fc6c9096-bcb9-458f-bd4a-94c51ef4c9af
📒 Files selected for processing (5)
src/main/persistence-duplicate-repo-id-host-scope.test.tssrc/main/persistence.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/runtime-remove-project-host-scope.test.tssrc/renderer/src/store/slices/repos-cross-host-project-collisions.test.ts
…nged emission Co-authored-by: Orca <[email protected]>
…up's own host The sibling-host fallback could only ever pick a row on a host the caller did not name; with no exact match the setup is stale and the existing path already drops just the setup. Co-authored-by: Orca <[email protected]>
…ce (stablyai#12215) * fix(repos): remove a paired computer's deleted projects from every connected device A project deleted on a paired Orca host stayed in every connected client's sidebar and could not be removed there. Two independent defects: 1. Host-local repo IPC mutations only sent `repos:changed` to the host's own renderer (src/main/ipc/repos.ts:2711). The runtime client-event stream was fed only by mutations arriving over runtime RPC, and clients refetch a remote catalog only on a `reposChanged` event -- there is no polling on desktop -- so the deleted rows persisted indefinitely. The shared `notifyReposChanged` helper now also calls the new `OrcaRuntimeService.notifyReposChangedForRemoteClients()` (src/main/runtime/orca-runtime.ts:5175), mirroring the existing `notifyWorktreesChangedForRemoteClients` precedent. This covers every repo, project-group and folder-workspace IPC mutation, so renames, colors, reorders and adds propagate too. 2. Deleting the ghost row on the client routed `repo.rm` to the owner, which answered `repo_not_found`. `removeProject` wrapped its whole body in one try/catch, so the rejection aborted the local purge before the `set()` (src/renderer/src/store/slices/repos.ts:3466) and the delete button appeared to do nothing. Only `repo_not_found` is now tolerated; any other failure still keeps the row, and an opt-in `errorFeedback: 'toast'` makes it visible at the three single-project user-initiated entry points. Bulk and background callers keep today's silence plus their own aggregate reporting. Closes stablyai#11994 Co-authored-by: Orca <[email protected]> * fix(repos): revert inert RepositoryPane removeProject arg The settings pane's only render site drops the argument; the toast is already delivered by removeSettingsProjectFromAllHosts. Co-authored-by: Orca <[email protected]> * fix(repos): scope duplicate-repo-id deletes to the owning execution host Cover the cross-host collisions stablyai#11994's broadcast now fans out to every paired device. Same-name projects on different hosts were already isolated (per-host UUIDs, host-scoped catalog merge and purge) and are pinned by regression tests. Two same-repo-id paths were not: `repo.rm` with a `path:`/`name:` selector and `deleteProjectHostSetup` both resolved one row and then deleted by bare id, taking the sibling host's registration with it. Co-authored-by: Orca <[email protected]> * test(mobile): align the poll-interval rationale with the new reposChanged emission Co-authored-by: Orca <[email protected]> * fix(repos): resolve deleteProjectHostSetup's repo row only on the setup's own host The sibling-host fallback could only ever pick a row on a host the caller did not name; with no exact match the setup is stale and the existing path already drops just the setup. Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Orca <[email protected]>
Summary
A project deleted on a paired Orca host (the reporter's mac mini) stayed in every connected client's sidebar forever, and clicking Delete on the ghost row did nothing. Two independent defects compounded.
1. The host never told paired clients its catalog changed. Deleting a project in the host's own UI hits the
repos:remove/repos:removeForHostIPC handlers (src/main/ipc/repos.ts:2060and:2067), which call the module-local helpernotifyReposChanged(src/main/ipc/repos.ts:2710) — a baremainWindow.webContents.send('repos:changed')to the host's own renderer. The runtime client-event stream was fed only by the privateOrcaRuntimeService.notifyReposChanged()(src/main/runtime/orca-runtime.ts:5061), which runs solely for mutations arriving over runtime RPC. A continuously-connected client refetches a remote catalog only on an incomingreposChangedevent, a transport gap, an environment becoming reachable, or first mount (src/renderer/src/hooks/useIpcEvents.ts:934/993/1007/1033) — there is no polling on desktop, so the deleted rows persisted indefinitely.Fixed by adding the public sibling
notifyReposChangedForRemoteClients()(src/main/runtime/orca-runtime.ts:5178), directly mirroring the existingnotifyWorktreesChangedForRemoteClientsprecedent at:5170, and calling it from the single sharednotifyReposChangedhelper. It deliberately does not callthis.notifier?.reposChanged(): the IPC path already sentrepos:changedto the local window, and re-sending would re-sort the host's own sidebar. Because it lives in the shared helper, every IPC mutation that already routed throughnotifyReposChanged— repo add, remove, removeForHost, update, reorder, clone, project-host-setup create/update/delete,projectGroups:*andfolderWorkspaces:*— now fans out with one edit; renames, colors and reorders were equally invisible before. Paths that never called that helper are unchanged and still do not reach paired clients (projects:updateinsrc/main/ipc/repos.ts:1336, and the SSH re-adoption path noted under Trade-offs). The runtime is wired in throughsetRepoRemoteClientNotifier(runtime)insrc/main/window/attach-main-window-services.ts:109, mirroring thesetWorktreeBaseDirectoryWatcherSyncContextcall five lines below it.2. The ghost row could not be deleted on the client. Deleting it routed
repo.rmto the owner runtime (src/main/runtime/rpc/methods/repo.ts:218→OrcaRuntimeService.removeProject), whoseresolveRepoSelectorthrowsrepo_not_found(src/main/runtime/orca-runtime.ts:27552). The renderer'sremoveProjectwrapped its entire body in one try/catch whose handler was a bareconsole.error(src/renderer/src/store/slices/repos.ts:3468), so the rejection aborted the local purge before theset()— the row survived and the user saw nothing at all.Fixed by scoping a try/catch to just the removal call (
src/renderer/src/store/slices/repos.ts:3315) and tolerating exactlyrepo_not_foundviahasRuntimeRpcErrorCode, matching theisRuntimeRepoNotFoundErrorprecedent atsrc/renderer/src/store/slices/worktrees.ts:959. That predicate is prose-safe — it matches a structuredcodefield, or the code as a whole message or after a real message boundary — so it cannot swallow a genuine transport failure. Everything after the call (hook-trust clear, cache eviction,terminal.stop, PTY kills,purgeWorktreeTerminalState, the bigset()) then runs unchanged. The outer catch additionally shows an error toast, but only when the caller passeserrorFeedback: 'toast'— the two single-project user-initiated entry points: the Settings pane's "Remove Project" button (Settings.tsx:1839→removeSettingsProjectFromAllHosts, which toasts once per failing host setup) and the sidebar's Remove Folder dialog (RemoveFolderDialog.tsx:62).removeProjectstill never throws and still returnsvoid.Closes #11994
ELI5
You have Orca open on two computers that talk to each other. You delete a project on the first computer. The first computer told its own window "the project list changed" but never told the second computer, and the second computer only ever looks again when it's told to — so the deleted project just sat there on the second screen. Worse, if you tried to delete the leftover row on the second computer, it asked the first computer to delete a project that was already gone, got an error back, gave up halfway, and showed you nothing — so the button looked broken. Now the first computer announces every project-list change to everyone connected, and if a client is told "that project is already gone," it takes that as success and cleans up its own copy. Real failures now show an error message instead of failing silently.
Fix proof
Before (repro test,
src/renderer/src/store/slices/repos.bug-11994.test.ts— the file has since been renamed, see below):After — the repro was promoted to the repo's descriptive naming convention as
src/renderer/src/store/slices/repos-remove-missing-remote-project.test.tsand broadened to cover the non-tolerated codes and the opt-in toast, and a new main-side suitesrc/main/ipc/repos-remote-client-events.test.tslocks the broadcast:No regressions
Main-side repo IPC + window wiring (
src/main/ipc/repos-remote.test.ts,repos-create.test.ts,repos-picker.test.ts,repos-sparse-presets.test.ts,repos-add-linked-worktree.test.ts, the newrepos-remote-client-events.test.ts,src/main/window/attach-main-window-services.test.ts):Runtime (
src/main/runtime/orca-runtime.test.ts,multi-client-navigation-isolation.integration.test.ts):Renderer repo slices (
repos-remove-missing-remote-project,repos-remove-project-purge-leak,repos-host-identity-routing,repos-selected-owner-routing,repos-project-runtime,repos-project-groups-delete):Settings / sidebar / all-hosts merge (
settings-project-list,RepositoryPane,ssh-host-remove-resolution,repos-all-hosts,repos-all-hosts-folder-workspaces,repos-all-hosts-generation,runtime-catalog-merge-removed-env-guard):Mobile (
mobile/src/worktree/host-worktree-refresh.test.ts, comment-only change there):One pre-existing assertion was updated rather than left red:
settings-project-list.test.ts:275asserted the exactremoveProjectcall shape and now expects the addederrorFeedback: 'toast'.Trade-offs
runtime-project-refresh-scheduler.ts:23-24), so a host user dragging the color picker will not storm them. Mobile clients do not debounce (mobile/src/worktree/host-worktree-refresh.ts:71-74firesfetchWorktrees()plusfetchRepoMetadata({ force: true, queueIfInFlight: true }), andforcebypasses the 60s throttle), so repeated host-side Settings edits can drive repeatedrepo.list+worktree.pson connected phones. Bounded byqueueIfInFlightcollapsing concurrent metadata fetches, by mobile already pollingworktree.psevery 3s (andrepo.list~1×/min) while foregrounded, and by the fact that runtime-RPC-driven mutations already emit this event un-debounced today — the IPC path merely reaches parity.repo_not_found) — same outcome as today, just legible instead of invisible.src/main/ipc/ssh.ts:933(takeRepoReadoptions) rewrites repo host ownership after an SSH-target re-adoption and still sends only the localrepos:changed. That module does hold a runtime handle (currentRuntime,src/main/ipc/ssh.ts:64, already used fornotifySshStateChanged); it simply was not wired to the new repo broadcast here, to keep this change to the one shared helper. Paired clients stay stale on that one path.projects:update(src/main/ipc/repos.ts:1336) likewise notifies nobody, as before. Separate follow-up.Cross-platform
No platform-conditional code, no keyboard handling, no accelerators, no shortcut labels, no filesystem path construction. The change is one runtime event emission, one module-scope setter, two renderer error branches (the
repo_not_foundtolerance and the opt-in toast), one i18n string, two call sites passingerrorFeedback: 'toast', and a comment.attachMainWindowServices, which re-registers the repo handlers and reassigns the notifier holder; Windows and Linux take the identical path once at startup.runtimeis a module-level process singleton insrc/main/index.ts:323(assigned once at:2345), so the holder cannot go stale.repos:remove(id-only) andrepos:removeForHost(host-scoped — the SSH multi-host forget path), so removing an SSH-backed row propagates identically. On the renderer side the tolerance sits after the existingcleanupEphemeralVmRuntimesForDeletedcall for runtime-owned SSH targets and before the host-scopedrepoMatchesHostIdentitypurge, so cross-host duplicate repo ids still only lose the owning host's row (covered by a regression case). Theterminal.stopRPCs for a now-missing repo were alreadyPromise.allSettled. Making the toast opt-in specifically protects the SSH forget flow (ssh-host-remove-workspaces.ts:45-67), which removes an entire offline host's repos in a loop and reports failures itself.isFolderRepo,connectionId, or git state, and the same shared helper covers theprojectGroups:*and folder-workspace handlers, so non-git folder workspaces need no special case.Performance
Main adds one
emitClientEventwherevernotifyReposChangedalready ran: every host-local repo IPC mutation, plus the background git-remote-identity / username enrichment thatrepos:list,projects:listandprojectHostSetups:listkick off — that enrichment fires itsonChangedat most once per pass, and only when a value actually changed and was persisted, so it converges rather than repeating. With no paired clients the emit iterates an emptySet. NonotifyReposChangedcall site insrc/main/ipc/repos.tssits inside a loop, so the realistic maximum is one event per user action. The emit is synchronous and fire-and-forget, and cannot throw into the IPC handler:notifyRuntimeListeners(orca-runtime.ts:33654) try/catches every listener, and the call site is additionally guarded so a broadcast failure can never fail the mutation the user actually asked for. No new loop is possible — a client's reaction is a read-onlyrepo.list/worktreerefresh that arrives over runtime RPC and cannot re-enter anipcMainhandler.Renderer adds one try/catch and one string predicate on an already-async user-initiated action. Client-side refresh cost is quantified under Trade-offs above.
Security
No change. No new IPC channel, preload surface, or RPC method;
registerRepoHandlers' signature is unchanged (the wiring is a separate exportedsetRepoRemoteClientNotifier).{ type: 'reposChanged' }already exists inRuntimeClientEvent(src/shared/runtime-client-events.ts:12), so there is no protocol or capability gate to add, and the event carries no repo identity, path, or other payload — clients react by issuing their normal authenticatedrepo.list, which is subject to the same scope checks as before. No command execution, no path handling, no auth surface touched. The renderer'srepo_not_foundtolerance is deliberately narrow:hasRuntimeRpcErrorCodematches a structuredcodefield, or the code only as a whole message or after a real message boundary (asserted inruntime-rpc-result.test.ts:55/64), so prose containing the token cannot trigger a local purge, andselector_ambiguousstays fatal.AI Review Report
Reviewed by independent subagents in a loop until clean, across two hostile lenses — correctness/regressions and cross-platform + remote + performance.
Made with Orca 🐋