YousefED / SyncedStore

SyncedStore CRDT is an easy-to-use library for building live, collaborative applications that sync automatically.
https://syncedstore.org
MIT License
1.71k stars 51 forks source link

Example react app appears to be broken across browser windows #55

Closed josephdangerstewart closed 2 years ago

josephdangerstewart commented 2 years ago

Hello! I was investigating using yjs in a react project, and started designing my own abstraction when I came across this project. It looks really cool although I haven't been able to get state to sync across two browser windows. Oddly enough, the state syncs when I have my app open in two tabs in the same browser window. I haven't pushed my code anywhere as I'm still playing around with different approaches before incorporating a solution into my main project, but I was able to repro the issue in the react example app: https://3xemy.csb.app/, if you open that link in a chrome window, and then open it again in a second incognito window, the state doesn't get synced across the two windows. In my local playground app, I use y-webrtc as my provider and determined that the two windows are indeed connecting to each other, but haven't investigated much beyond that.

josephdangerstewart commented 2 years ago

Actually, I think this may be an issue with yjs (possibly with it's public signaling server?). I made an example with vanilla yjs and it still doesn't work, although if I initially connect in a new tab and drag that tab into a new window it does work