Comments (4)
Removing this line, removes the error, but also the persistency
const ydocIndexeddbProvider = new IndexeddbPersistence(docName, ydoc);
from y-indexeddb.
Unable to reproduce
from y-indexeddb.
It is this function that throws
export const findRootTypeKey = type => {
// @ts-ignore _y must be defined, otherwise unexpected case
for (const [key, value] of type.doc.share.entries()) {
if (value === type) {
return key
}
}
throw error.unexpectedCase()
}
Can you explain how the === may not be met? - in particular in light of using a Y.Array on JS (proxy [vue]) objects
The test contains some kind of recursion: value
is a value of the map type.doc.share.entries()
, which howeve is compared against type
- but the mentioned map comes from a nested field of type
from y-indexeddb.
More info: It happens when the syncing from IndexedDB is still in progress and we already access somewhere else yDoc.getArray("events")
EDIT: If i wait with calling yDoc.getArray("events")
until ydocIndexeddbProvider.on('synced')
has been called, the error disappears! For example by using a promise and resolving it in the on-synced callback - and (only) then (i.e. upon then
) calling the getArray
from y-indexeddb.
Related Issues (20)
- Syncing problems HOT 1
- Can we use IPFS Connector? HOT 5
- CommonJS require doesn't work HOT 1
- Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key HOT 1
- ClearData does not return a Promise HOT 1
- y-indexeddb does not set the correct origin on initial load HOT 1
- init ydoc from indexeddb failed HOT 7
- Filter by transaction-origin instead of mutexes
- provider.destroy() may cause race condition HOT 2
- Blocked IDB event forces a page reload HOT 1
- duplicated update for multiple IndexeddbPersistence and single Y.Doc HOT 7
- A way to know if an update has been stored (feedback) HOT 5
- Performance on `IndexeddbPersistence` HOT 1
- Doc grows without any changes HOT 11
- sub-doc syncing support HOT 3
- Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found. HOT 1
- reliable 'synced' or loaded event HOT 6
- indexdb not defined HOT 1
- observe does not work for Y.Map of Y.Arrays HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from y-indexeddb.