ueberdosis / hocuspocus

The CRDT Yjs WebSocket backend for conflict-free real-time collaboration in your app.
https://tiptap.dev/docs/hocuspocus/introduction
MIT License
1.19k stars 115 forks source link

Allow token fn to return null #838

Closed fuadsaud closed 1 month ago

fuadsaud commented 2 months ago

The token passed as a value can be null already, so the code that calls the function will continue to work as intended.

Allowing a null value makes it possible to still open a connection without a token while attempting to fetch the token in an async function.

fuadsaud commented 1 month ago

It seems that this might not work since this line doesn't deal well with a null-returning function. I'll think a bit more about the design.