Commit Graph

15 Commits

Author SHA1 Message Date
228cfb57c0 fix(core-realtime): address Phase 2 code review (typing, error handling, params)
- Type socket.data.user via AppSocketData/AppSocket generics (no more any)
- Wrap Gate 1 authenticator call in try/catch so exceptions reject the
  connection with connect_error instead of being swallowed
- Fix Gate 3 userScoped channel authorize: derive params.userId from the
  authenticated socket user so owner-inbound is accepted
- Await io.close(callback) in stop() to ensure full shutdown
- Remove unused httpServer field from constructor (io already holds the ref)
- Extract CHANNEL_ROOM_PREFIX/channelRoom helper to channel-room.ts;
  replace three `ch:${name}` magic strings; re-export from index
- Add JSDoc to ChannelScope explaining userScoped params/template convention
- Fix "allows subscribe + invokes handler with ctx" test: hoist received
  outside beforeEach and assert ctx shape
- New test: rejects connection when authenticator throws
- New test: userScoped channel accepts inbound from owner, rejects from anon
2026-05-08 21:52:52 +02:00
964fabf796 fix(core-realtime): remove unused PLACEHOLDER var and ClientSocket import (lint) 2026-05-08 21:16:44 +02:00
d4a3f95938 feat(core-realtime): public barrel 2026-05-08 21:16:22 +02:00
2939ff8bb5 feat(core-realtime): SocketIORealtimeServer (4 lifecycle gates) 2026-05-08 21:16:03 +02:00
9d04bdc65b feat(core-realtime): SocketIORealtimeBroadcaster 2026-05-08 21:15:07 +02:00
86b9418758 feat(core-realtime): IRealtimeServer interface 2026-05-08 21:14:43 +02:00
5e57c66140 feat(core-realtime): InMemoryRealtimeBroadcaster (test/dev impl) 2026-05-08 21:14:33 +02:00
6c5484b874 feat(core-realtime): RealtimeHandlerRegistry 2026-05-08 21:14:11 +02:00
f072435024 feat(core-realtime): authorize function (4 scope kinds) 2026-05-08 21:13:48 +02:00
0771601571 feat(core-realtime): channel-template matcher (placeholder extraction) 2026-05-08 21:13:18 +02:00
691b4942d5 feat(core-realtime): IRealtimeAuthenticator interface 2026-05-08 21:12:56 +02:00
caf86abbe5 feat(core-realtime): IRealtimeHandler + IInboundDescriptor types 2026-05-08 21:12:47 +02:00
795511b5b3 feat(core-realtime): IRealtimeBroadcaster interface + symbol registry 2026-05-08 21:12:36 +02:00
7e922bc406 feat(core-realtime): RealtimeChannelDescriptor + defineRealtimeChannel 2026-05-08 21:12:24 +02:00
bbdb456aa0 chore(core-realtime): scaffold package
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 20:58:05 +02:00