Chiti: Replacing 11 Sockets With One Typed Real-Time Layer
One socket for a six-role delivery and taxi app, then the real work: an 11.3 second handshake, positions the server accepted but never stored, and a token that went stale in the background.
In short
- Eleven unauthenticated Socket.IO connections became one connection per session, owned by a single module that components never touch.
- Status pings invalidate queries, position frames patch the cache, everything else goes on a small typed bus. Frames are parsed as unknown with Zod.
- Real devices taught more than design did: an 11.3 second handshake, a position the server broadcast but never stored, and a socket that stayed anonymous after a token refresh.
#react-native#socket-io#typescript#tanstack-query