You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, in the createDatasource function it calls openDB with promise, which can be a race condition.
Distribution version
Web (dev.affine.live)
What browsers are you seeing the problem on if you're using web version?
Firefox
Relevant log output
DOMException: IDBDatabase.transaction: 'workspace' is not a known object store name
wrapFunction wrap-idb-value.js:150
queryDocState provider.ts:40
p lazy-provider.ts:48
f lazy-provider.ts:134
C lazy-provider.ts:170
connect provider.ts:118
connect indexeddb-provider.ts:19
syncProviders main.ts:94
initWorkspace main.ts:127
main main.ts:152
<anonymous> main.ts:155
Anything else?
Error is probably caused like this. As they produce the same result in the dev-tools' indexeddb pannel, and raise the same error.
import{createIndexedDBProvider,}from'@toeverything/y-indexeddb';import{openDB}from'idb';import*asYfrom'yjs';constyDoc=newY.Doc({// we use `guid` as unique keyguid: 'my-doc',});constprovider=createIndexedDBProvider(yDoc,'PLAYGROUND_DB');(awaitopenDB('PLAYGROUND_DB')).transaction('workspace','readwrite').objectStore('workspace');provider.connect();
Are you willing to submit a PR?
Yes I'd like to help by submitting a PR!
The text was updated successfully, but these errors were encountered:
Do you know how to reproduce the issue? I think the error DOMException: IDBDatabase.transaction: 'workspace' is not a known object store name in your example is that you need to pass a upgradeDB function like the following to create object store first:
What happened?
AFFiNE/packages/y-indexeddb/src/provider.ts
Lines 116 to 118 in c8b2728
After call function
createIndexedDBProvider
, you need to callconnect
function inside it to connect to it to create a indexeddb.AFFiNE/packages/y-indexeddb/src/provider.ts
Lines 25 to 41 in c8b2728
However, in the
createDatasource
function it callsopenDB
with promise, which can be a race condition.Distribution version
Web (dev.affine.live)
What browsers are you seeing the problem on if you're using web version?
Firefox
Relevant log output
Anything else?
Error is probably caused like this. As they produce the same result in the dev-tools' indexeddb pannel, and raise the same error.
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: