Skip to content
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

filterBcConns = true doesn't work #10

Closed
areebbeigh opened this issue Apr 9, 2020 · 3 comments
Closed

filterBcConns = true doesn't work #10

areebbeigh opened this issue Apr 9, 2020 · 3 comments

Comments

@areebbeigh
Copy link

areebbeigh commented Apr 9, 2020

Using filterBcConns: true in options still uses broadcast channels instead of a webrtc connection for tabs in the same browser. Tested on Chrome: Version 79.0.3945.79 (Official Build) (64-bit) and Firefox: 74.0 (64-bit) on Ubuntu 18.04

@diegodorado
Copy link

the same happens to me.
I believe the option should be disableBroadcastChannels and do not even subscribe/unsuscribe on connect/disconnect

@areebbeigh
Copy link
Author

areebbeigh commented May 31, 2020

I suppose I wasn't paying enough attention. filterBcConns: false is what makes sense is what works if I want browser tabs to use webRTCConns. I think the readme has it wrong.

That, or the default value in the constructor is should be false, not true - which makes more sense since filterBcConns is basically hypothetical !allowBcConns?

@dmonad
Copy link
Member

dmonad commented May 31, 2020

All Yjs connectors use broadcastchannels to exchange document updates efficiently window-to-window. It is a cheap method to exchange document updates when no internet connection is available.

It doesn't make sense to me to disable the broadcastchannel (there is no advantage in that).
Creating a webrtc connection instead of a broadcastchannel will just delay syncing. Furthermore, it is not possible to create WebRTC connection without a network connection.

The idea is that a WebRTC connection is only created if the client is not already connected via broadcastchannel. Therefore, filterBcConns.

But you are right @areebbeigh . The mentioned section is wrong.

@dmonad dmonad closed this as completed in f67d31e May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants