Dexie.js icon indicating copy to clipboard operation
Dexie.js copied to clipboard

Stoping pending queries / bulk unsubscribe

Open frankleng opened this issue 1 year ago • 3 comments

I have useLiveQuery in an React app where these are run after user signs in.

Upon signing out, we run db.delete() to wipe user data Occasionally I see a few DBClosed error when the user signs out, all from live queries.

Is there a way to unsubscribe/stop these queries in bulk?

frankleng avatar Dec 18 '23 20:12 frankleng

2nd thought, maybe these queries were triggered by running db.delete() using indexedDB.deleteDatabase(DB_NAME) directly bypassing Dexie seems to have fixed the issue

frankleng avatar Dec 18 '23 20:12 frankleng

What version of dexie are you using? I think we did some improvements of the delete behavior in dexie@4.

dfahlander avatar Dec 18 '23 20:12 dfahlander

@dfahlander on 3.2.4. but have tried 4.x and same issue

frankleng avatar Dec 19 '23 09:12 frankleng