yjs / y-websocket

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

I can't check sync status #90

Closed vitonsky closed 2 years ago

vitonsky commented 2 years ago

Please save me some time and use the following template. In 90% of all issues I can't reproduce the problem because I don't know what exactly you are doing, in which environment, or which y-* version is responsible. Just use the following template even if you think the problem is obvious.

Checklist

Describe the bug In readme we have info about synced property of WS provider with description "True if this instance is currently connected and synced with the server."

First of all, this property marked as private in typescript declaration, so we have to cast types to get value.

Well, i have checked value of this property to know current status and this property is always false.

How it work? How i can get current sync status for the document?

To Reproduce Steps to reproduce the behavior:

  1. Create instance of WebsocketProvider
  2. Wait getting data for your doc
  3. Check doc.provider.synced any time

Expected behavior Property is reflect of current synchronization status and it's false when document is not synced and true when we got all data

Actual behavior Property always false, so we can't know sync status

Screenshots If applicable, add screenshots to help explain your problem.

Environment Information

Additional context I need check current sync status, so sync event is not that thing i need

vitonsky commented 2 years ago

It's not a library bug

thiagodejesus commented 5 months ago

Hi @vitonsky , can you please explain what was causing the issue for you? Also had the problem here and I didn't find the reason