Skip to content

Add a timeout status event - #127

Open
manan-jadhav wants to merge 1 commit into
yjs:masterfrom
CodeGemx:feat/timeout-event
Open

manan-jadhav wants to merge 1 commit into
yjs:masterfrom
CodeGemx:feat/timeout-event

Conversation

@manan-jadhav

Copy link
Copy Markdown
  • A new status event: 'timeout' is fired when there has been inactivity on the websocket for a while and the websocket is marked for closing
  • This is really handy with detecting network disconnection, because in that case the websocket does not really fire the 'close' event until the browser has finished the closing handshake.
  • Added documentation for this

@andreyleskov

Copy link
Copy Markdown

Is it possible to merge this? I use tldraw with y-websocket and observe weird behavior of all whiteboard to refresh and lose ability to react to hotkeys. Took me a few days to dig in and find the reason of y-websocket auto-close on inactivity.
Now server cannot distinguish it from document delete-related socket closure. Additional timeout status would save several hours of debug.

@dmonad

dmonad commented Jul 9, 2024

Copy link
Copy Markdown
Member

The idea of the status event is to tell the user about the connection status. Hence, I'd prefer to add a status event { status: 'disconnecting', reason: 'timeout' | 'manual' }.

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.

3 participants