yjs / y-indexeddb

IndexedDB database adapter for Yjs
https://docs.yjs.dev/ecosystem/database-provider/y-indexeddb
Other
196 stars 30 forks source link

fix: ignore redundant update from multiple instances #26

Closed doodlewind closed 1 year ago

doodlewind commented 1 year ago

Fixes #25

dmonad commented 1 year ago

Hi @doodlewind & @Himself65

This won't work if you initialize two IndexeddbProviders to different room names. Think about this valid use-case:

  const provider = new IndexeddbPersistence('one', doc)
  const provider2 = new IndexeddbPersistence('two', doc)

The two persistence providers won't be able to sync anymore if we merge this PR.

I think you should fix the issue on your end and ensure that only one IndexeddbProvider is initialized.