You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add SSE for email new message events and wire unread badges into the shell sidebar.
Requirements
GET /api/ctrl/email/stream SSE endpoint: polls D1 for new messages every 30s, emits {type: "new_message", threadId, messageId} events. Keepalive comment every 30s
apps/ctrl/src/lib/sse/email-sse.ts: SSE client with auto-reconnect (exponential backoff 1s-30s)
On new_message event: invalidate thread list query, update mailbox unread count in sidebar
Toast notification for new email
Desktop Notification API if tab backgrounded (with permission request)
Goal
Add SSE for email new message events and wire unread badges into the shell sidebar.
Requirements
Out of Scope
Complete when: New emails trigger SSE event, sidebar badge updates, toast/desktop notifications fire.
Dev Workflow
Each step is mandatory. No exceptions. No skipping steps. No committing to main. No solo merges.
feat/<issue#>-<description>from main. Use git worktrees for parallel work.pnpm test,pnpm check(oxlint + oxc-format). All must pass./simplifyon all changed files. Accept structural improvements, flatten unnecessary abstractions, remove dead code. Commit the result./review-prwhich launches parallel review agents (code review, silent failure hunter, type design analysis). Fix every issue found. Re-run tests after fixes.Platform Rules
any-- useunknownand narrowtests/mirroring source tree, never colocatedDone When