Skip to content

Remove a paired computer's deleted projects from every connected device - #12215

Merged
nwparker merged 6 commits into
mainfrom
nwparker/bugbash-11994
Aug 4, 2026
Merged

nwparker merged 6 commits into
mainfrom
nwparker/bugbash-11994

Conversation

@nwparker

@nwparker nwparker commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

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:removeForHost IPC handlers (src/main/ipc/repos.ts:2060 and :2067), which call the module-local helper notifyReposChanged (src/main/ipc/repos.ts:2710) — a bare mainWindow.webContents.send('repos:changed') to the host's own renderer. The runtime client-event stream was fed only by the private OrcaRuntimeService.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 incoming reposChanged event, 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 existing notifyWorktreesChangedForRemoteClients precedent at :5170, and calling it from the single shared notifyReposChanged helper. It deliberately does not call this.notifier?.reposChanged(): the IPC path already sent repos:changed to 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 through notifyReposChanged — repo add, remove, removeForHost, update, reorder, clone, project-host-setup create/update/delete, projectGroups:* and folderWorkspaces:* — 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:update in src/main/ipc/repos.ts:1336, and the SSH re-adoption path noted under Trade-offs). The runtime is wired in through setRepoRemoteClientNotifier(runtime) in src/main/window/attach-main-window-services.ts:109, mirroring the setWorktreeBaseDirectoryWatcherSyncContext call five lines below it.

2. The ghost row could not be deleted on the client. Deleting it routed repo.rm to the owner runtime (src/main/runtime/rpc/methods/repo.ts:218 → OrcaRuntimeService.removeProject), whose resolveRepoSelector throws repo_not_found (src/main/runtime/orca-runtime.ts:27552). The renderer's removeProject wrapped its entire body in one try/catch whose handler was a bare console.error (src/renderer/src/store/slices/repos.ts:3468), so the rejection aborted the local purge before the set() — 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 exactly repo_not_found via hasRuntimeRpcErrorCode, matching the isRuntimeRepoNotFoundError precedent at src/renderer/src/store/slices/worktrees.ts:959. That predicate is prose-safe — it matches a structured code field, 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 big set()) then runs unchanged. The outer catch additionally shows an error toast, but only when the caller passes errorFeedback: '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). removeProject still never throws and still returns void.

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):

 ❯ src/renderer/src/store/slices/repos.bug-11994.test.ts (1 test | 1 failed) 19ms
     × drops the ghost row when the remote reports repo_not_found 18ms

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  src/renderer/src/store/slices/repos.bug-11994.test.ts > bug 11994: deleting a project already removed on the remote host > drops the ghost row when the remote reports repo_not_found
AssertionError: expected [ 'project-a', 'project-b' ] to deeply equal [ 'project-a' ]

- Expected
+ Received

  [
    "project-a",
+   "project-b",
  ]

 ❯ src/renderer/src/store/slices/repos.bug-11994.test.ts:90:59
     88|     await store.getState().removeProject('project-b', { hostId: 'runti…
     89|
     90|     expect(store.getState().repos.map((repo) => repo.id)).toEqual(['pr…
       |                                                           ^
     91|   })
     92| })

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯


 Test Files  1 failed (1)
      Tests  1 failed (1)
   Start at  21:59:17
   Duration  1.86s (transform 1.29s, setup 0ms, import 1.77s, tests 19ms, environment 0ms)

After — the repro was promoted to the repo's descriptive naming convention as src/renderer/src/store/slices/repos-remove-missing-remote-project.test.ts and broadened to cover the non-tolerated codes and the opt-in toast, and a new main-side suite src/main/ipc/repos-remote-client-events.test.ts locks the broadcast:

 Test Files  2 passed (2)
      Tests  9 passed (9)
   Start at  02:06:14
   Duration  1.77s (transform 2.12s, setup 0ms, import 1.69s, tests 1.31s, environment 0ms)

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 new repos-remote-client-events.test.ts, src/main/window/attach-main-window-services.test.ts):

 Test Files  7 passed (7)
      Tests  188 passed (188)
   Start at  02:06:24
   Duration  2.62s (transform 5.77s, setup 0ms, import 7.50s, tests 1.45s, environment 0ms)

Runtime (src/main/runtime/orca-runtime.test.ts, multi-client-navigation-isolation.integration.test.ts):

 Test Files  2 passed (2)
      Tests  1010 passed | 1 skipped (1011)
   Start at  02:06:34
   Duration  13.46s (transform 9.63s, setup 0ms, import 12.74s, tests 7.36s, environment 0ms)

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):

 Test Files  6 passed (6)
      Tests  40 passed (40)
   Start at  02:06:58
   Duration  1.68s (transform 6.21s, setup 0ms, import 8.90s, tests 321ms, environment 0ms)

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):

 Test Files  7 passed (7)
      Tests  61 passed (61)
   Start at  02:07:10
   Duration  3.03s (transform 7.99s, setup 0ms, import 10.97s, tests 427ms, environment 160ms)

Mobile (mobile/src/worktree/host-worktree-refresh.test.ts, comment-only change there):

 Test Files  1 passed (1)
      Tests  5 passed (5)
   Start at  02:07:23
   Duration  106ms (transform 20ms, setup 0ms, import 28ms, tests 5ms, environment 0ms)

One pre-existing assertion was updated rather than left red: settings-project-list.test.ts:275 asserted the exact removeProject call shape and now expects the added errorFeedback: 'toast'.

Trade-offs

  • Deleting, renaming or reordering a project on the host now costs paired clients one catalog refresh. Desktop clients coalesce to at most one refresh per environment per 5s (250ms debounce / 5s minimum interval — 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-74 fires fetchWorktrees() plus fetchRepoMetadata({ force: true, queueIfInFlight: true }), and force bypasses the 60s throttle), so repeated host-side Settings edits can drive repeated repo.list + worktree.ps on connected phones. Bounded by queueIfInFlight collapsing concurrent metadata fetches, by mobile already polling worktree.ps every 3s (and repo.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.
  • Removal failures at the two single-project entry points now surface an error toast where they were previously silent. Removing a ghost row whose owning host is unreachable still fails (that error is not repo_not_found) — same outcome as today, just legible instead of invisible.
  • Known remaining hole, unchanged by this PR: src/main/ipc/ssh.ts:933 (takeRepoReadoptions) rewrites repo host ownership after an SSH-target re-adoption and still sends only the local repos:changed. That module does hold a runtime handle (currentRuntime, src/main/ipc/ssh.ts:64, already used for notifySshStateChanged); 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.
  • Verification is unit-test only. Everything above was exercised with Vitest on macOS; there was no live two-machine (mac mini ↔ macbook) pairing run, and no Linux or Windows run. The code paths are platform-agnostic (see below), but the end-to-end reporter scenario has not been replayed on real hardware.

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_found tolerance and the opt-in toast), one i18n string, two call sites passing errorFeedback: 'toast', and a comment.

  • macOS / Linux / Windows: identical. macOS re-activation re-runs attachMainWindowServices, which re-registers the repo handlers and reassigns the notifier holder; Windows and Linux take the identical path once at startup. runtime is a module-level process singleton in src/main/index.ts:323 (assigned once at :2345), so the holder cannot go stale.
  • SSH-remote: explicitly covered. The broadcast lives in the shared helper used by both repos:remove (id-only) and repos: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 existing cleanupEphemeralVmRuntimesForDeleted call for runtime-owned SSH targets and before the host-scoped repoMatchesHostIdentity purge, so cross-host duplicate repo ids still only lose the owning host's row (covered by a regression case). The terminal.stop RPCs for a now-missing repo were already Promise.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.
  • Folder workspaces (non-git): nothing in the change inspects isFolderRepo, connectionId, or git state, and the same shared helper covers the projectGroups:* and folder-workspace handlers, so non-git folder workspaces need no special case.
  • Git binary / provider: no git subcommand, option, or provider-specific naming is added, so the 2.25 baseline and GitLab/other-provider constraints are untouched.

Performance

Main adds one emitClientEvent wherever notifyReposChanged already ran: every host-local repo IPC mutation, plus the background git-remote-identity / username enrichment that repos:list, projects:list and projectHostSetups:list kick off — that enrichment fires its onChanged at 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 empty Set. No notifyReposChanged call site in src/main/ipc/repos.ts sits 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-only repo.list / worktree refresh that arrives over runtime RPC and cannot re-enter an ipcMain handler.

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 exported setRepoRemoteClientNotifier). { type: 'reposChanged' } already exists in RuntimeClientEvent (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 authenticated repo.list, which is subject to the same scope checks as before. No command execution, no path handling, no auth surface touched. The renderer's repo_not_found tolerance is deliberately narrow: hasRuntimeRpcErrorCode matches a structured code field, or the code only as a whole message or after a real message boundary (asserted in runtime-rpc-result.test.ts:55/64), so prose containing the token cannot trigger a local purge, and selector_ambiguous stays fatal.

AI Review Report

Reviewed by independent subagents in a loop until clean, across two hostile lenses — correctness/regressions and cross-platform + remote + performance.

  • Review loop count: 1 round(s)
  • Final verdict: CLEAN
  • No outstanding findings.

Made with Orca 🐋

…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]>
@nwparker
nwparker requested a review from brennanb2025 as a code owner August 3, 2026 05:10
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@nwparker, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d84f630e-f10a-4353-829d-47fb846be6d3

📥 Commits

Reviewing files that changed from the base of the PR and between 74e023b and 8468c3b.

📒 Files selected for processing (2)
  • src/main/persistence-duplicate-repo-id-host-scope.test.ts
  • src/main/persistence.ts
📝 Walkthrough

Walkthrough

The changes add remote-client reposChanged notifications for repository IPC mutations and register the runtime notifier during main-window setup. Repository removal now supports duplicate IDs across execution hosts through host-scoped deletion. Renderer removal handles missing remote repositories and supports explicit toast or silent feedback. Tests cover notification behavior, host isolation, catalog refresh, and removal errors. Mobile documentation describes refresh compatibility with newer and older desktop builds.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: removing deleted projects from connected devices.
Description check ✅ Passed The description clearly explains the change, testing, risks, security review, platform impact, trade-offs, and known limitations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between c9a37f5 and 9c519f5.

📒 Files selected for processing (14)
  • mobile/src/worktree/host-worktree-refresh.ts
  • src/main/ipc/repos-remote-client-events.test.ts
  • src/main/ipc/repos.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/window/attach-main-window-services.test.ts
  • src/main/window/attach-main-window-services.ts
  • src/renderer/src/components/settings/RepositoryPane.tsx
  • src/renderer/src/components/settings/settings-project-list.test.ts
  • src/renderer/src/components/settings/settings-project-list.ts
  • src/renderer/src/components/sidebar/RemoveFolderDialog.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/repos-remove-missing-remote-project.test.ts
  • src/renderer/src/store/slices/repos.ts

Comment thread src/renderer/src/store/slices/repos.ts Resolved
nwparker and others added 2 commits August 2, 2026 22:36
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]>
@nwparker

nwparker commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

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.
Repo ids are per-host randomUUID() (src/main/ipc/repos.ts:337/:435), so a name collision is two distinct ids. Removal routes by the owner host: settingsForRepoOwner (repos.ts:1365) derives the RPC target from the row executionHostId, never the focused env, so repo.rm cannot land on the wrong host and have the new repo_not_found tolerance purge a live sibling. The local purge filters on repoMatchesHostIdentity (id and host). The catalog refetch this PR now triggers prunes only rows whose getRepoExecutionHostId equals the fetched catalog host (mergeFetchedReposForHost, repos.ts:888-891). Regression tests added for both directions.

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 repo_not_found ghost path), and a host-side delete on env-A followed by an env-A catalog refetch leaves the local and env-B rows alone.

3. Same repo id on two execution hosts — two real defects, both fixed here.

  • OrcaRuntimeService.removeProject (orca-runtime.ts:18247) resolved one row and then called the id-only Store.removeProject. A bare duplicated id is rejected as selector_ambiguous, but a path:/name: selector resolves unambiguously and then deleted both host rows. Now scoped to the resolved row host via removeProjectForHost.
  • Store.deleteProjectHostSetup (persistence.ts:4191) resolved a repo by bare setup.repoId and deleted by bare id — deleting one host setup removed the sibling host registration too. Now prefers the setup own host row and deletes only it. This path is one of the handlers this PR newly fans out to paired devices, so the loss would have propagated everywhere immediately.

New tests (each verified to fail without its fix, and the regression pins verified by mutating the host scoping in repos.ts):

  • src/renderer/src/store/slices/repos-cross-host-project-collisions.test.ts (9)
  • src/main/runtime/runtime-remove-project-host-scope.test.ts (3)
  • src/main/persistence-duplicate-repo-id-host-scope.test.ts (3)

Known remaining gap (not introduced here, not fixed here): repo-derived project host setups reuse the repo id as the setup id (project-host-setup-projection.ts:241), so with a duplicated repo id both host setups share one setup id and deleteProjectHostSetup can only resolve one of them. It now deletes exactly the row it resolved and reports it, so no cross-host data loss — but a caller cannot choose which host setup to delete. Fixing that needs a host-qualified setup id, which is a separate change.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9c519f5 and fb0feef.

📒 Files selected for processing (5)
  • src/main/persistence-duplicate-repo-id-host-scope.test.ts
  • src/main/persistence.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/runtime-remove-project-host-scope.test.ts
  • src/renderer/src/store/slices/repos-cross-host-project-collisions.test.ts

Comment thread src/main/persistence.ts Resolved
nwparker and others added 3 commits August 4, 2026 00:05
…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]>
@nwparker
nwparker merged commit 96e31e7 into main Aug 4, 2026
43 checks passed
@nwparker
nwparker deleted the nwparker/bugbash-11994 branch August 4, 2026 08:26
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Deleted Remote Computer's Projects Are Still Showing

1 participant