feat(service): seal a workspace's pending invitations for following over Neon Realtime

Merged
CH
7d ago
+291-6

The service side of a workspace's live pending invitations. Stacked on #3942.

  • New live procedure live.workspaceInvitations:
    • an owner or an admin gets one sealed statement plus the service's origin for accept links
    • a plain member gets not-permitted, and an outsider not-found
  • Statement: reads the plugin's pending invitation rows and gates on the reader's managing role.
  • Expiry filter on the desktop: expiresAt > now moves to workspaceInvitationsOfLiveRows, so the statement stays deterministic.

Tests

  • Parity against Better Auth's real plugin over PGlite: canceled and expired invitations, an owner and an admin, and a member and an outsider who get nothing.
  • Procedure test.
  • Immutability check.

Made with Luke