-
Notifications
You must be signed in to change notification settings - Fork 67
Closed
Description
Hi, we are getting this error intermittently and we are having a really hard time recreating it and diagnosing what's happening. Does anyone here have an idea what's going on or have a suggestion of how we can debug it.
When the error occurs it prevents our app from initializing.
- This is being called inside a Web Worker.
- We use the Web Locks API to ensure that only an instance of this Web Worker exists.
import sqlite3InitModule from "@sqlite.org/sqlite-wasm";
// The sqlite3 wasm module needs to be initialized by the browser before
// it can be used. This must only be done once. We eagerly start this
// initialization process when this module is imported.
const modulePromise = sqlite3InitModule({
print: console.log,
printErr: console.error,
});
export async function createPersistedClientDatabaseAdapter(props: {
logger: Logger;
/** Resets the database on init, clearing all existing data. */
clearOnInit?: boolean;
}) {
const sqlite3 = await modulePromise;
const poolUtil = await sqlite3.installOpfsSAHPoolVfs({
clearOnInit: props.clearOnInit,
directory: "/sqlite3",
});
props.logger.info({ poolUtil });
const sqliteDB = new poolUtil.OpfsSAHPoolDb(`/comms.db`); // intermittent error
}
jorroll
Metadata
Metadata
Assignees
Labels
No labels