We have a bug that a new runtime doesn't really know about any other runtimes. It only keeps itself in the list of clients and notifies other runtimes about itself. That's not right.
BroadcastChannel is not a good API to introduce a shared state because one has to constantly keep that state in-sync. Instead, I propose we use localStorage to keep the serialized list of all the WebSocket clients for the app.
Changes
We have a bug that a new runtime doesn't really know about any other runtimes. It only keeps itself in the list of clients and notifies other runtimes about itself. That's not right.
BroadcastChannel is not a good API to introduce a shared state because one has to constantly keep that state in-sync. Instead, I propose we use
localStorage
to keep the serialized list of all the WebSocket clients for the app.Roadmap
src/core/ws/WebSocketClientManager.test.ts
tests, the constructor signature and the behavior ofWebSocketClientManager
have changed.