-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Able to get queryCache to break #278
Comments
This may be because not using atomicUpsert :) Checking |
Wonder if having upsert be atomic by default, and then having asyncUpsert being the backup would potentially be a better first-principles approach. |
Tried to reproduce with this test: it('#278 insert and upsert many docs', async() => {
console.log('-------');
const db = await RxDatabase.create({
name: util.randomCouchString(10),
adapter: 'memory'
});
const collection = await db.collection({
name: 'human',
schema: schemas.primaryHuman
});
const docData = new Array(1000)
.fill(0)
.map(() => schemaObjects.simpleHuman());
for (const doc of docData)
await collection.insert(doc);
const docData2 = clone(docData);
docData2.forEach(doc => doc.lastName = doc.lastName + '1');
for (const doc of docData2)
await collection.upsert(doc);
console.log(':::::');
db.destroy();
}); But could not reproduce. |
Could reproduce and fix this now. |
Need some time, I actually tried disabling Hoping I get some time today or later this week to properly give you a test case. I did get it to replicate (actually I couldn't get it not to bug recently, not sure if its a corrupted db or something else but it is throwing pointer errors with or without the queryCache enabled. But will get a good test case soon. Edit: see that you found a way to replicate, very cool. |
Case
Getting these errors in node:
Seems to happen when upserting a bunch of stuff. The roughest approximation I have is to have a large amount (~80 rows) of items to upsert (lots of text and fields). Then go through in a loop and call upsert for all of them.
I could attempt to serialize this into a test case, but it is very tied into a deep area of the stack. I think the basic gist is: lots of data, upsert many rows at once.
Let me know I can try and narrow this down.
Info
The text was updated successfully, but these errors were encountered: