Skip to content

feat(service): seal the account's workspaces for following over Neon Realtime - #3915

Merged
luke-agent[bot] merged 1 commit into
mainfrom
luke/live-workspaces-service
Oct 21, 2026
Merged

luke-agent[bot] merged 1 commit into
mainfrom
luke/live-workspaces-service

Conversation

@charleslpan

@charleslpan charleslpan commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

The service side of the live workspaces list, on the central live layer (liveRows and the sealed live procedures).

  • New live procedure live.workspaces (GET /api/live/workspaces, in live-procedures.ts). It seals the bearer's workspaces as two statements, workspaces and installations, through sealedParts. With LUKE_REALTIME off, or when polled, it answers the rows inline as a held read. It's gated by sameUser like every live read.
  • Statements (workspacesLiveStatements in workspace-store.ts):
    • same joins and the same rule for who may read as listWorkspaces
    • aliased with liveSelection, with no now() and no ORDER BY
    • the photo digest is computed in SQL with immutable functions only: decode(replace(logo, '\', '\\'), 'escape') instead of convert_to, giving the same sha256
  • Reader (workspacesOfLiveRows in the new workspace-live.ts) orders the rows the way the held read does.
  • roleOf moves to workspace-wire.ts so the desktop reads a role the same way the service does.
  • Export: sealedLiveQuerySchema is exported again, now that a second module uses it.

Tests

  • PGlite parity: the live rows equal listWorkspaces for an owner, a teammate and an outsider.
  • The procedure seals both parts for the bearer and refuses a missing bearer.
  • live-statements.test.ts passes the statements through mutableFunctionsOf and the Drizzle adapter.

The live read refuses a forUser other than the bearer (sameUser, 401). Its photo check is the same as workspacePhotoOfDataUrl: a whole base64 payload and a real PNG, JPEG or WEBP signature.

Made with Luke

@vercel

vercel Bot commented Oct 19, 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 21, 2026 6:30am UTC

Request Review

@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-shared-socket branch 3 times, most recently from 21e5770 to 7bbd164 Compare October 20, 2026 01:44
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-service branch from 7cb060d to c600a09 Compare October 20, 2026 02:34
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-service branch from c600a09 to 89c8baa Compare October 20, 2026 03:26
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-shared-socket branch 2 times, most recently from e95f277 to 9589265 Compare October 20, 2026 22:20
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-service branch from 89c8baa to 6ec4fdd Compare October 21, 2026 00:11
@luke-agent
luke-agent Bot changed the base branch from luke/neon-realtime-shared-socket to main October 21, 2026 00:11
@luke-agent luke-agent Bot closed this Oct 21, 2026
@luke-agent luke-agent Bot reopened this Oct 21, 2026
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-service branch from 6ec4fdd to 0ad1b30 Compare October 21, 2026 00:28
@luke-agent
luke-agent Bot marked this pull request as ready for review October 21, 2026 00:36
@luke-agent
luke-agent Bot enabled auto-merge October 21, 2026 00:41
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-service branch from 0ad1b30 to 3c0d72b Compare October 21, 2026 00:45
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

… Neon Realtime

The live procedure `workspaces` (GET /api/live/workspaces) seals the
bearer's workspaces as two live statements, the workspaces and the GitHub
installations connected to them, with the same joins and rule of who may
read them as listWorkspaces, or answers their rows inline where the reader
polls or Realtime cannot seal them. What the held read works out from a row
is worked out in the statement, so no photo's bytes travel: its digest, the
Linear connection's standing, and each installation's. The digest reads the
logo's bytes through decode(…, 'escape') over its text with each backslash
doubled, since Realtime refuses convert_to, which Postgres marks only
stable. The desktop orders the rows (workspace-live.ts's
workspacesOfLiveRows), since Realtime keeps none.

roleOf moves to workspace-wire, so the desktop reads a role as the service
does.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-service branch from 173d121 to ecb47c8 Compare October 21, 2026 06:27
@luke-agent
luke-agent Bot enabled auto-merge October 21, 2026 06:27
@luke-agent
luke-agent Bot added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit e34039d Oct 21, 2026
13 checks passed
@luke-agent
luke-agent Bot deleted the luke/live-workspaces-service branch October 21, 2026 06:38

This branch was successfully deployed

1 active deployment
Preview — ecb47c81 Deployed Oct 21, 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