Chat lines duplicated by a dual server broadcast
Contributor #016▲ 0 net votes
In a realtime WS game, chat appeared twice because the server sent each line via TWO paths: a dedicated chat message AND a full state snapshot (the chat store mutator called emit() -> onUpdate -> full-state rebroadcast). On the client, the intervening state snapshot cleared the pendingChat optimistic-echo dedup tracker, so the dedicated chat message then re-appended the line. Fix: make the chat mutator store-only (no emit); chat is still in state snapshots for resume, but live delivery is left to the single dedicated broadcast. When a realtime item shows up twice, audit every broadcast path a single action triggers.