Skip to content

feat(service): seal a workspace's members and former members for following over Neon Realtime - #3929

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

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

Conversation

@charleslpan

@charleslpan charleslpan commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

The service side of a workspace's live members. Stacked on #3924.

  • New live procedure live.workspaceMembers (GET /api/live/workspace-members?workspaceId=):
    • answers not-found unless the bearer is a member, as the held read does
    • otherwise seals members and former, or answers the rows inline when polled or when Realtime is off
  • Statements gate on the reader's own membership, so a member who leaves stops getting rows. The former-member condition (formerOf) is shared with the held read.
  • Reader: workspaceMembersOfLiveRows (workspace-live.ts) orders members by role, then by name, as the held read does.

Tests

  • PGlite parity against listMembers / listFormerMembers for the owner, an admin and a member. An outsider and a member who left get nothing.
  • Procedure test.
  • Immutability check.

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 7:06am UTC

Request Review

@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-host branch from 9e1f8c5 to 6e6dfed Compare October 20, 2026 02:34
@luke-agent
luke-agent Bot force-pushed the luke/live-members-service branch from ca5afa8 to 17a7182 Compare October 20, 2026 02:34
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-host branch from 6e6dfed to 95763dc Compare October 20, 2026 03:26
@luke-agent
luke-agent Bot force-pushed the luke/live-members-service branch from 17a7182 to 5f956e8 Compare October 20, 2026 03:26
@luke-agent
luke-agent Bot force-pushed the luke/live-members-service branch from 5f956e8 to b471d1c Compare October 21, 2026 00:11
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-host branch from 95763dc to fb59c46 Compare October 21, 2026 00:11
@luke-agent
luke-agent Bot force-pushed the luke/live-members-service branch from b471d1c to da68eb9 Compare October 21, 2026 00:28
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-host branch from fb59c46 to 9b4a760 Compare October 21, 2026 00:29
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-host branch from 9b4a760 to 685f1aa Compare October 21, 2026 00:45
@luke-agent
luke-agent Bot force-pushed the luke/live-members-service branch from da68eb9 to 44adfcc Compare October 21, 2026 00:45
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-host branch from 685f1aa to aa837ee Compare October 21, 2026 01:05
@luke-agent
luke-agent Bot force-pushed the luke/live-members-service branch from 44adfcc to 3c49fce Compare October 21, 2026 01:05
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-host branch from aa837ee to 331235a Compare October 21, 2026 01:17
@luke-agent
luke-agent Bot force-pushed the luke/live-members-service branch from 3c49fce to 43da746 Compare October 21, 2026 01:17
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-host branch from 331235a to d3b723d Compare October 21, 2026 01:32
@luke-agent
luke-agent Bot force-pushed the luke/live-members-service branch from 43da746 to 3847df7 Compare October 21, 2026 01:32
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-host branch from d3b723d to 7cf0d7b Compare October 21, 2026 06:27
@luke-agent
luke-agent Bot force-pushed the luke/live-members-service branch from 3847df7 to a5e9d60 Compare October 21, 2026 06:27
@luke-agent
luke-agent Bot force-pushed the luke/live-workspaces-host branch from 7cf0d7b to 713c87b Compare October 21, 2026 06:44
@luke-agent
luke-agent Bot force-pushed the luke/live-members-service branch from a5e9d60 to 4131bf4 Compare October 21, 2026 06:44
Base automatically changed from luke/live-workspaces-host to main October 21, 2026 06:54
…n Realtime

The live procedure `workspaceMembers` (GET
/api/live/workspace-members?workspaceId=) seals one workspace's people for
the bearer as two live statements, its members and who its work names but
left, after reading the account as a member of it, so a workspace it is not
in is not found, as the held read answers; or answers their rows inline
where the reader polls or Realtime cannot seal them. Each statement also
holds the reader's own membership, so a member who leaves stops reading its
rows. The former members' condition is shared with the held read
(formerOf), both statements call only immutable functions, and the desktop
orders the rows as the held read does (workspaceMembersOfLiveRows).

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@luke-agent
luke-agent Bot force-pushed the luke/live-members-service branch from 4131bf4 to ec60fc3 Compare October 21, 2026 07:01
@luke-agent
luke-agent Bot marked this pull request as ready for review October 21, 2026 07:07
@luke-agent
luke-agent Bot added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit c493c5a Oct 21, 2026
12 of 13 checks passed
@luke-agent
luke-agent Bot deleted the luke/live-members-service branch October 21, 2026 07:08

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

Devin Review

Comment thread packages/features/src/workspace-live.ts Resolved

This branch was successfully deployed

1 active deployment
Preview — ec60fc36 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