Skip to content

Commit

Permalink
Removing a 4.0 test that happened to slip through to 3.x in a cherry-…
Browse files Browse the repository at this point in the history
…pick operation.
  • Loading branch information
dfahlander committed Feb 8, 2024
1 parent 7c2f083 commit d7f8d85
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions test/tests-misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,52 +422,6 @@ promisedTest("Issue #1333 - uniqueKeys on virtual index should produce unique re
ok(result.length === 2, `Unexpected array length ${result.length} from uniqueKeys on virtual index, expected 2. Got ${result.join(',')}`);
});

/** Reproduce customer issue where ReadonlyError was thrown when using liveQuery.
*/
promisedTest("Issue - ReadonlyError thrown in liveQuery despite user did not do write transactions", async () => {
// Encapsulating the code in a string to avoid transpilation. We need native await here to trigger bug.
ok(!Promise.PSD, "Must not be within async context when starting");
ok(db.isOpen(), "DB must be open when starting");
await new Promise(resolve => setTimeout(resolve, 10));
const F = new Function('ok', 'equal', 'Dexie', 'db', 'liveQuery', `
ok(true, "Got here");
return (async ()=>{
equal(Dexie.Promise.PSD.id, 'global', "PSD is the global PSD");
const observable = liveQuery(async () => {
console.debug("liveQuery executing");
const result = await db.metrics.toArray();
//await 3;
async function foo() {
console.log("qm PSD.id = " + Dexie.Promise.PSD?.id);
await db.metrics.toArray();
console.log("qm PSD.id = " + Dexie.Promise.PSD?.id);
}
foo(); // Be naughty and spawn promises that we don't await.
// Verify that we handle this situation and escape from zone echoing before
// we return the result.
return result;
});
equal(Dexie.Promise.PSD.id, 'global', "PSD is the global PSD");
ok(true, "Now awaiting promise subscribing to liveQuery observable");
console.log("before await in global");
await new Promise(resolve => {
const o = observable.subscribe(val => {
o.unsubscribe();
console.log("PSD.id = " + Dexie.Promise.PSD?.id);
resolve(val);
});
});
console.log("after await in global");
console.log("Got result from observable");
equal(Dexie.Promise.PSD.id, "global", "PSD is still the global PSD");
await db.transaction('rw', db.metrics, () => {}); // Fails if we're in a liveQuery zone
})();
`);
return F(ok, equal, Dexie, db, liveQuery).catch(err => ok(false, 'final catch: '+err));
});


promisedTest("Issue #1890 - BigInt64Array getting corrupted after an update", async () => {
if (typeof BigInt64Array === 'undefined') {
ok(true, "BigInt64Array not supported in browser");
Expand Down

0 comments on commit d7f8d85

Please sign in to comment.