[x] Are you reporting a bug? Use github issues for bug reports and feature requests. For general questions, please use https://discuss.yjs.dev/
[x] Try to report your issue in the correct repository. Yjs consists of many modules. When in doubt, report it to https://github.com/yjs/yjs/issues/
Is your feature request related to a problem? Please describe.
When a change happens and the provider is not connected yet and or currently offline, the change is lost.
Describe the solution you'd like
At the moment messages are only sent, when the websocket is available. Otherwise the update is just lost. The API also does not provide any methods to deal with initial connect in a nice way.
I have a react effect that connects to a y-sweet server whenever a ID changes. So it works like this:
Checklist
[x] Are you reporting a bug? Use github issues for bug reports and feature requests. For general questions, please use https://discuss.yjs.dev/ [x] Try to report your issue in the correct repository. Yjs consists of many modules. When in doubt, report it to https://github.com/yjs/yjs/issues/
Is your feature request related to a problem? Please describe.
When a change happens and the provider is not connected yet and or currently offline, the change is lost.
Describe the solution you'd like
At the moment messages are only sent, when the websocket is available. Otherwise the update is just lost. The API also does not provide any methods to deal with initial connect in a nice way.
I have a react effect that connects to a y-sweet server whenever a ID changes. So it works like this:
But when init is called, the doc is provider is not available yet. Therefore I had to wait for the connection to be established
I think there should be a limited queue to handle this problem or network hiccups.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.