What did I miss?
A chat client reconnects after a tunnel drops it for ninety seconds and shows an empty gap where ninety seconds of conversation should be. The messages were delivered — to everyone whose connection was still up.
The live path is drawn and it works. What is missing is everything needed to answer one question a reconnecting client asks: what did I miss?
- R1A client that reconnects sends the identifier of the last message it actually received, and the server must be able to return everything after that point. It is asked for a position, not for whatever is current, so it must be able to answer a question about the past rather than merely hand over the present.
- R2History is kept for a bounded window because it grows without limit. Beyond that window it moves somewhere cheap and complete that can still be read later, and the client is told its resume point is too old rather than being handed a silent gap.
- R3A message sent right now reaches every server holding a member of that conversation, so that each of them can push it to the connections it holds. One server receiving it must not mean the others do not.
Outside every boundary: Other socket node (holds the rest), Everyone else, Reconnecting client (knows its last id), Socket node (holds connections), an empty slot for the answers everything after message N, tier 1, an empty slot for the history older than the window, tier 1, an empty slot for the reaches every node holding a member, tier 2 Connections: Reconnecting client holds an open connection to Socket node Everyone else holds an open connection to Other socket node Socket node calls answers everything after message N — everything after N answers everything after message N publishes to history older than the window — past the window Socket node publishes to reaches every node holding a member reaches every node holding a member publishes to Other socket node