Open davidje13 opened 5 years ago
To prevent missed or duplicated messages after reconnection, the server will need to keep track of which messages it has already handled;
Client UUIDs are known only to the server and the client, not other clients. It may also be necessary to limit the maximum number of UUIDs tracked by the server (perhaps including a timestamp in each entry and removing the oldest to maintain a maximum count, or more simply by keeping an ordered list in most-recently-used order)
For simplicity, my preferred approach here has changed:
json-immutability-helper
Close events are currently detected, but ignored (except for cancelling keepalive pings)
The client should attempt to automatically reconnect if the connection is lost unintentionally. This should use retry logic with an increasing delay to avoid self-DDoS.
If connection is lost for several seconds without reconnecting, a non-intrusive message should be displayed to the user.