What should be tested when a WebSocket connection is interrupted?
Answer
Check handshake and authorization, heartbeat and timeout behaviour, reconnect backoff, resubscription, duplicate or missing messages, ordering, offline UI state and recovery after server restart. Confirm that reconnects do not bypass access controls.
Strong answer includes
- connection lifecycle
- message integrity
- authorization after reconnect
Practical example
During a chat app test, the tester kills the WebSocket connection mid-session with a proxy tool, confirms the client shows an 'offline' banner and buffers outgoing messages, then restores the network and verifies the client resubscribes to the same channels and that no message got duplicated or lost in the process.