feat(host): follow the workspaces list over Neon Realtime

Merged
CH
8d ago
+513-280

The host follows the workspaces list on liveRows instead of reading it on focus and after writes. Stacked on #3915.

  • The follow (workspaces-follow.ts, and followWorkspaces in compose-tasks.ts) runs from the first TASKS_REFRESH after a launch or sign-in until sign-out, and writes each change onto the tasks view. Every window and web tab already hears that view.
  • Held polls: with Realtime off it polls through #4272's held read (the after digest), so a change lands in about a second.
  • Seals name the account (?userId=). A signed-out answer stops the follow; any other failure is resealed on the board's backoff.
  • Removed: the workspaces read on focus, the once-a-minute bound, and the re-read after every workspace write. A rename or a photo still draws the service's answer at once.
  • GitHub connection: the account's GitHub-connection check is compared against the clock, so it can't be live. It stays a one-off read on refresh and focus, at most once a minute.

Tests

compose-tasks.test.ts:

  • a teammate's change lands
  • a failed subscription is polled until it's resubscribed
  • a seal that goes unanswered shows reading while the tasks still draw
  • one follow stands across refreshes, focus and writes until sign-out

Made with Luke