Workspace Presence: Detect Missed Realtime Messages and Refetch Authoritative State
Recovering who is online requires choosing between reconstructing an event history and replacing a stale view; for a marketplace auction workspace, replace the view whenever its sequence has a gap. TL;DR: track the last accepted sequence on the client, refetch authoritative state after a discontinuity, and report gap frequency. A connected socket alone doesn't establish that the displayed…
The report discusses the issue of detecting missed realtime messages in a shared auction workspace, and how to refetch an authoritative state when there is a gap in the sequence. The key points are that a connected socket alone does not guarantee the displayed participant roster is current, and the application must establish a trustworthy state boundary.
The solution involves tracking the last accepted sequence on the client, refetching the authoritative state after a discontinuity, and reporting gap frequency. The report provides an example using Go, but emphasizes that the contract lies with the application, regardless of the server framework. The design assumes an ordered sequence domain, contiguous numbers for updates, and an authoritative snapshot carrying the sequence through which the state is complete.
By using this approach, the client can distinguish between a repaired roster and a socket that merely resumed receiving traffic.
Brief written by urgent.news from Dev.to's own syndicated text. Machine-written — may contain errors; check the original before relying on it.