Issue when peer got reconnected after disconnected by using webrtc provider
Opened this issue · 6 comments
Describe the bug
I’m currently trying to run two instances of this demo (but changed the provider to webrtc) on my local (using two different port). When one instance (user1) got disconnected and then got reconnected again, at first both content from user1 and user will get synced again.
But when user1 tries to add new content, user2 will not receive the update from user1 anymore, but update user2 will still be received by user1 (the updates will become one-direction only).
But this issue didn’t occur when I tried this by using websocket provider. Is there some extra configuration needed to make sure y-webrtc can handle this scenario? or is this a bug on y-webrtc? please let me know if I’m missing something or if you need more information.
To Reproduce
- Clone this example, change the provider from websocket to webrtc, like this:
// const provider = new WebsocketProvider('wss://demos.yjs.dev', 'prosemirror-demo', ydoc) #commented
const provider = new WebrtcProvider('demo-ywebrtc', ydoc);
- Run two instances of the example on your local
- Make one of the instances offline
- Make that instance online again
- Now changes from that instance won't get synced with other instances anymore, but changes from other instances will still get synced with that instance.
Expected behavior
The reconnected instance's update will get propagated to other peers as usual.
Screenshots
Not a screenshot, but I’ve created a short screencast to reproduce the issue in case my explanation is not clear enough.
Environment Information
- Google Chrome Browser on Linux Ubuntu 18.04
- yjs@13.4.12
- y-webrtc@10.1.8
Edit: Still got the same issue on yjs@13.5.5
Additional context
I don't know if this is relevant, but this issue is also occurring on a real connection test (using two ubuntu VM connected by VirtualBox's default NAT network config, and by making one of the VM offline).
Update: So I've done more trials using VM and turns out that sometimes the sync workflow works correctly, but sometimes it doesn't.
hi, any update about this issue?
I have also experienced this issue. What's more interesting, I'm using WebrtcProvider
in conjunction with ProseMirror
, and the cursor position won't get propagated after the connection has been lost and reestablished again.
I am seeing similar issues. I have an app running on Edge and Chrome on one Win10 PC and Chrome on a Chromebook. All are using the WebRTC provider with the default signaling servers. And the IndexedDb provider.
Initially an update on a Browser was seen on the others, however now updates on Chrome on Win10 aren't seen on the other two Browsers. However the other two Browsers see each others changes. I've restarted the Win10 PC and this made no difference.
I've enabled webrtc logging and when I do an update on the Chrome + Win10 PC nothing is logged on the other two Browsers. Updates on the other two Browsers do show log entries on the other Browser.
Opening a second Chrome Tab in a second Chrome Window on the Win10 PC does show updates, but only from the other Win10 Chrome Tab.
If I delete all YJS content and .clearData() from indexeddb then all browsers communicate and update correctly again.
Any update on this?
Oh I think this has been fixed in the last PR. Can you please test the latest version?