Title: refactor(tables): adopt shared durable event-log core [4/N] by waleedlatif1 · Pull Request #5934 · simstudioai/sim · GitHub
Open Graph Title: refactor(tables): adopt shared durable event-log core [4/N] by waleedlatif1 · Pull Request #5934 · simstudioai/sim
X Title: refactor(tables): adopt shared durable event-log core [4/N] by waleedlatif1 · Pull Request #5934 · simstudioai/sim
Description: Realtime Rooms — Phase 4 of N (Tables adopts the durable-log) Stacked on #5932. Completes the abstraction's second delivery mode: Tables adopts the shared durable event log (the server→client, replayable half — distinct from the Socket.IO presence half). Behavior-preserving; no wire or client change. Recall the design: one shared room identity + authz spine, two delivery modes — Presence (Socket.IO, Workflow + Files) and Durable log (Redis buffer + SSE, Tables + Execution). This PR generalizes the durable-log half. What changed lib/realtime/event-log.ts — domain-neutral Redis sorted-set + monotonic-id + TTL log with in-memory fallback. Parameterized by a key prefix and an entry serializer (Lua splice head/tail + a byte-identical memory builder), so a domain keeps its exact wire shape and Redis keys. lib/realtime/event-stream-route.ts — the SSE mechanics (replay ?from=, tail-from-latest, chunked poll, heartbeat, pruned/rotate) as a factory. Auth + contract parsing stay in the route (domain-specific). lib/table/events.ts — now a thin adapter. Keeps table:stream: and {eventId, tableId, event} verbatim and every exported name. table stream route — a thin call to the factory. The one hazard, avoided Renaming the Redis prefix would reset the seq counter → a connected client's in-memory lastEventId (e.g. 5000) would dedupe away every new low-id event with no pruned signal → silent stream death on every deploy. The adapter keeps table:stream: exactly; only new durable-log families get fresh prefixes. Verification All 454 existing Tables tests pass (behavior gate) + 6 new event-log core tests (monotonic ids, stream isolation, read-since, tail-latest, prune-on-cap, prune-on-missing). use-table-event-stream.ts untouched (same wire format). tsc clean; check:api-validation ✅. 🤖 Generated with Claude Code
Open Graph Description: Realtime Rooms — Phase 4 of N (Tables adopts the durable-log) Stacked on #5932. Completes the abstraction's second delivery mode: Tables adopts the shared durable event log (the server→client, ...
X Description: Realtime Rooms — Phase 4 of N (Tables adopts the durable-log) Stacked on #5932. Completes the abstraction's second delivery mode: Tables adopts the shared durable event log (the server→clie...
Opengraph URL: https://github.com/simstudioai/sim/pull/5934
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:e2408cf3-2a30-a19e-500f-6cb7d3b52ce5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8880:160F17:206BB8:2D64F7:6AFB50D1 |
| html-safe-nonce | 1413ced4a02ed331c54d52bcb4485a14b77bcdd55ef2597b122c729c56c242c0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODgwOjE2MEYxNzoyMDZCQjg6MkQ2NEY3OjZBRkI1MEQxIiwidmlzaXRvcl9pZCI6IjUwMTA2MjEyMTg1Mzc4MjAzNjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7a0199d3e92c48c23d110480dd23392163c7a1d921f1e29afe521ffe0a226b79 |
| hovercard-subject-tag | pull_request:4127136207 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5934/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Realtime Rooms — Phase 4 of N (Tables adopts the durable-log) Stacked on #5932. Completes the abstraction's second delivery mode: Tables adopts the shared durable event log (the server→client, ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cbf66c024bb6d10e6955baa7413c54cf13a201bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width