Closed KrishnaPG closed 4 years ago
Describe the bug IndexeddbPersistence.set() method has problems.
IndexeddbPersistence.set()
Checkout this line of code https://github.com/yjs/y-indexeddb/blob/2d21bdfc8ba7e862148f574cb1ce79c25c025e1b/src/y-indexeddb.js#L152
and then check this definition of put method from lib0:
put
export const put = (store, item, key) => rtop(store.put(item, key))
https://github.com/dmonad/lib0/blob/8a89d8d369c9dccd1187a75c04232e2a1ce39b7b/indexeddb.js#L126
The lib0 is expecting item followed by key as parameters, while the set call in this package is sending key first and then value next, which is leading to the error:
lib0
item
key
set
value
Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key
Thanks for noticing. Fixed it
Describe the bug
IndexeddbPersistence.set()
method has problems.Checkout this line of code https://github.com/yjs/y-indexeddb/blob/2d21bdfc8ba7e862148f574cb1ce79c25c025e1b/src/y-indexeddb.js#L152
and then check this definition of
put
method from lib0:https://github.com/dmonad/lib0/blob/8a89d8d369c9dccd1187a75c04232e2a1ce39b7b/indexeddb.js#L126
The
lib0
is expectingitem
followed bykey
as parameters, while theset
call in this package is sendingkey
first and thenvalue
next, which is leading to the error: