Skip to content

feat(service): the Mac's held read is woken by Neon Realtime rather than its poll - #3302

Closed
charleslpan wants to merge 3 commits into
luke/neon-realtime-service-wakefrom
luke/neon-realtime-mac-held-wake
Closed

charleslpan wants to merge 3 commits into
luke/neon-realtime-service-wakefrom
luke/neon-realtime-mac-held-wake

Conversation

@charleslpan

@charleslpan charleslpan commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #3266 (luke/neon-realtime-service-wake). Released desktops keep holding GET /api/mac-commands until the version gate cuts them off, so this PR makes that held read wait on Realtime too. Desktops on #3285 don't use this route.

Change

Tests

  • mac-command-store.test.ts (PGlite): the wake statement returns the account's unclaimed commands by id only, drops one once it's claimed, and reads nothing of another account's.
  • mac-commands-app.test.ts: with a scripted LiveWake, a held read answers a command queued while it's held as soon as the watch says the rows changed, with no TestClock advance. It also watches only the account's own statement. Without the change the test times out, because the read waits out its poll.

pnpm check:affected passes except apps/desktop/src/main/app-menu.test.ts, which is known to fail in the sandbox.

Made with Luke


Summary by cubic

Makes the Mac's held GET /api/mac-commands read wake on Neon Realtime instead of its 500 ms poll, so queued commands are answered as soon as they're queued.

  • macCommandsFor now waits on Realtime between looks through the new macCommandsWaitingLiveStatement, which selects the account's unclaimed command ids only. It falls back to the poll only where the deployment has no Realtime. The heartbeat, 20 s hold, and final claim are unchanged.

Written for commit 21eed83. Summary will update on new commits.

View guided diff

@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
luke-web Ready Ready Preview Oct 20, 2026 2:37am UTC

Request Review

@luke-agent
luke-agent Bot changed the base branch from main to luke/neon-realtime-service-wake October 17, 2026 01:52
@luke-agent luke-agent Bot closed this Oct 17, 2026
@luke-agent luke-agent Bot reopened this Oct 17, 2026
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-service-wake branch from 6c9622d to f835f49 Compare October 18, 2026 19:40
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-held-wake branch from 21eed83 to ce702b9 Compare October 18, 2026 19:47
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-service-wake branch from f835f49 to 2180711 Compare October 18, 2026 21:40
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-held-wake branch from ce702b9 to 71115fa Compare October 18, 2026 21:41
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-service-wake branch from 2180711 to e46eaf4 Compare October 19, 2026 18:52
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-held-wake branch from 71115fa to a9eb70b Compare October 19, 2026 18:52
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-service-wake branch from e46eaf4 to b3338fd Compare October 20, 2026 01:36
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-held-wake branch from a9eb70b to d4dd702 Compare October 20, 2026 01:36
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-service-wake branch from b3338fd to a768591 Compare October 20, 2026 02:06
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-held-wake branch from d4dd702 to 210bd8a Compare October 20, 2026 02:07
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-held-wake branch from 73c774a to 7198241 Compare October 20, 2026 02:20
charleslpan and others added 3 commits October 20, 2026 02:32
…han its poll

Released desktops keep holding GET /api/mac-commands until the version
gate cuts them off. Between looks the read now waits on Realtime's word
that the account's unclaimed commands changed (`lookedUntil` over
`macCommandsWaitingLiveStatement`, which names ids alone and no clock
window), and on its own 500 ms poll only where the deployment has no
Realtime.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…no polling fallback

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…unctions

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@luke-agent

luke-agent Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Closing for now: the developer moved every area onto the central live layer with Neon Realtime off (LUKE_REALTIME, #4267; held polls, #4272), and this change only does something with Realtime on. The branch is kept, so the PR can be reopened and rebased when LUKE_REALTIME goes back on.

@luke-agent luke-agent Bot closed this Oct 20, 2026

This branch was successfully deployed

1 active deployment
Preview — 7656c9cc Deployed Oct 20, 2026 by vercel[bot]
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.

1 participant