-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate 'close' listeners for WebRTC connection #21
Comments
Right. I duplicated that because the close handler is not called when the |
After I removed the part completely my issues were gone. The problem was that Maybe somewhere here? Lines 267 to 277 in e0d5d11
|
Maybe this is a misunderstanding. The intention is that y-webrtc automatically handles (and reconnects) connections unless you explicitly disconnect the provider instance (then no connection should be possible anymore). So when the connection to a peer is closed, then it will automatically subscribe to find more peers again. |
Whatever the reason was, your change fixed the issue. I had two browser windows being connected via y-webrtc and when reloading one of them the other one showed 2 connections. This is fixed now, probably due to the duplicate listening to 'close' being removed. Thanks! |
Oh nice! It makes sense as I simply assumed the second handler would be called after the first one (which might not be the case). Then I will publish a new release of this package as it seems to fix an issue. |
These lines seem to be wrong:
https://github.com/yjs/y-webrtc/blob/master/src/y-webrtc.js#L222-L225
The result of it is, that peers are not removed correctly anymore.
The text was updated successfully, but these errors were encountered: