yjs / y-websocket

Websocket Connector for Yjs
https://docs.yjs.dev/ecosystem/connection-provider/y-websocket
MIT License
523 stars 261 forks source link

Is beforeunload a correct event for reseting awareness state? #119

Closed mifopen closed 2 years ago

mifopen commented 2 years ago

Shouldn't it be just unload. beforeunload is often used to ask users about unsaved changes. It means that the user will be "disconnected" from the awareness protocol until they choose, for example, "exit without saving", "cancel" or "save".

Huly®: YJS-530

dmonad commented 2 years ago

Can you try out whether disconnecting will still work if we do it in the unload event?

mifopen commented 2 years ago

Yes, it does work

dmonad commented 2 years ago

Thanks for verifying. Added this change and made a release.