yjs / y-indexeddb

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

Fixes #31 #33

Closed DinosaurDad closed 1 year ago

DinosaurDad commented 1 year ago

No need to add an update in the constructor because we are just loading the document. This commit adds a no-op beforeApplyUpdatesCallback handler to avoid creating a spurious update.

raineorshine commented 1 year ago

I've tried this, and unfortunately it doesn't work. The tests will fail. beforeApplyUpdatesCallback is indeed needed for the initial sync.

I currently skip the update only if it is empty, which seems to be working.

I am going to do so more testing before submitting a PR, and wait to see if @dmonad has any input on #31. Glad to have someone else looking into the issue though.

DinosaurDad commented 1 year ago

Ah, I see the failing tests now. I will close this pull request.