yjs / y-indexeddb

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

reverse clearData order #14

Open YousefED opened 3 years ago

YousefED commented 3 years ago

I'm encountering a weird race issue when calling clearData

My assumption is that because destroy() calls idb.close, the onversionchange handler is never called. but at the same time, the idb handle is not really "closed" yet when we call deleteDB.

My solution would be to switch the order of the calls, see PR