Repository navigation
fix(app): track inbox session cutoff per server - #67442
Conversation
There was a problem hiding this comment.
The approach looks sound: persisted per-server cutoffs, with existing servers seeded at 0 so nothing disappears on upgrade. I ran the new unit tests (10/10 pass) and tsc -b for packages/app (clean). I couldn't run the new Playwright test here because no browser is installed, so I didn't see the before and after inbox behaviour myself. Screenshots of the inbox right after adding a server, on dev and on this branch, would help.
Public API: unchanged. The new optional serverCutoffs key is client-side persisted UI state in sidebar.inbox, and older stored state still decodes.
One case worth handling: removing a server and adding it again (inline comment).
| let next: Record<string, number> | undefined | ||
|
|
||
| for (const scope of scopes) { | ||
| if (current[scope] !== undefined) continue |
There was a problem hiding this comment.
Cutoffs are never cleared when a server is removed (servers.remove doesn't touch sidebar.inbox), so removing a server and adding it again later keeps its original cutoff. Everything it did between the first add and the re-add then floods the inbox, which is the case this PR is meant to prevent. Could the stale entry be dropped when the server leaves the list, or the cutoff reset when it's added again? Keep in mind the test's note that plugin servers can be absent only temporarily.
Summary
serverCutoffs) toSidebarInbox(opencode.global.dat:sidebar.inbox, keyed byServerScope) so adding a new server does not flood the inbox with its older sessions.0(no cutoff), so existing inbox items do not disappear on upgrade.Date.now()when first seen; their older settled and archived sessions stay hidden unless they are currently working, waiting for attention, pinned, or explicitly opened (and any session created/updated/archived at or after the cutoff appears normally).packages/app/src/shell/titlebar/inbox-cutoff.tswith unit tests, and add a multi-server Playwright regression test inpackages/app/e2e/regression/multi-server.spec.ts.Verification
bun test src/shell/titlebar/inbox-cutoff.test.ts: 10/10 passed.bun run --cwd packages/app typecheck: 0 errors.bun run --cwd packages/app typecheck:e2e: clean formulti-server.spec.ts.e2e/regression/multi-server.spec.ts -g inbox: 2/2 passed (including the new per-server cutoff regression).e2e/regression/tabs.spec.ts -g inbox: 15/15 Inbox sidebar tests passed (the 1 unrelated tab test"an unread tab whose run failed shows the failed dot, as the inbox does"fails ondevtoo).bun run lint:changed/ pre-pushoxlintpanics in the sandbox (oxc_allocatorfixed_size.rs:112), so CI will run lint.Requested by: @Brendonovich (Brendan via Slack)