yjs / y-indexeddb

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

y-indexeddb does not set the correct origin on initial load #17

Closed yufw closed 2 years ago

yufw commented 2 years ago

Describe the bug On initial load using y-indexeddb, event.transaction.origin is null and event.transaction.local is true.

To Reproduce Steps to reproduce the behavior:

  1. Create a basic example that uses y-indexeddb provider and ymap.observe(event => { console.log(event) }) to see the event on initial load.

Expected behavior The expected behavior is that event.transaction.origin should be the provider and event.transaction.local is set to false (because it is coming from a provider? not sure about the expected behavior here)

Environment Information

dmonad commented 2 years ago

Thanks for this! I fixed it and will release a new version shortly.