Skip to content

fix(websocket): use browser-valid close codes - #65

Open
peterkogo wants to merge 1 commit into
loro-dev:mainfrom
peterkogo:fix-disconnect
Open

peterkogo wants to merge 1 commit into
loro-dev:mainfrom
peterkogo:fix-disconnect

Conversation

@peterkogo

@peterkogo peterkogo commented Sep 26, 2026 •

Copy link
Copy Markdown

Replace close code 1001 with 1000 in offline and heartbeat timeout handlers. Browser WebSocket.close() rejects 1001, preventing the socket from closing and blocking reconnection.

You can easily reproduce this error by turning network on & off again in Chrome devtools. The socket reconnects but never attempts to reconnect again.

Replace close code 1001 with 1000 in offline and heartbeat timeout handlers. Browser WebSocket.close() rejects 1001, preventing the socket from closing and blocking reconnection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant