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

Merged
CH
8d ago
+380-78

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