Skip to content
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

database.remove() doesn't remove IndexedDB local documents #3319

Closed
ofekd opened this issue Aug 8, 2021 · 7 comments
Closed

database.remove() doesn't remove IndexedDB local documents #3319

ofekd opened this issue Aug 8, 2021 · 7 comments

Comments

@ofekd
Copy link

ofekd commented Aug 8, 2021

Case

Bug

Issue

GraphQL replication tried pulling new documents even after I ran db.remove(). Using the storage inspector in Firefox I could see the pull checkpoints were still there. I also suspect other local documents remain, but didn't have time to test.

In most browsers I can use IndexedDB.databases() to enumerate and delete them all manually. Does anyone know of a workaround for Firefox?

Info

  • RxDB Version: 10.0.2
  • Environment: Browser
  • Adapter: IndexedDB
  • Stack: Typescript, Babel, Vue
@pubkey pubkey closed this as completed in cf49802 Aug 9, 2021
@pubkey
Copy link
Owner

pubkey commented Aug 9, 2021

Thank you for reporting. Fixed in the attached commit.

@ofekd
Copy link
Author

ofekd commented Aug 9, 2021

Thank you for fixing, much appreciated

@ofekd
Copy link
Author

ofekd commented Aug 9, 2021

I have installed 10.0.3 and the pull checkpoint still persists after remove().

Is there a way to get the list of the pouch IndexedDB databases? I would like to erase everything, regardless of remove().

@pubkey
Copy link
Owner

pubkey commented Aug 9, 2021

I am not sure how to get all indexeddb databases.
Can you make a PR with a test to reproduce the problem?
In the new release we remove the whole local document store, so I do not see any way how the checkpoint can still persist.

@ofekd
Copy link
Author

ofekd commented Aug 9, 2021

I see in the storage explorer that RxDB created IndexedDB databases for both version 0 and version 1 of my schema (currently set to version 1 in the schema file). Is that intentional? I think it has something to do with it because the graphql pull checkpoint is set in the version 0 database. This was a fresh DB so it's not something that carried from old data.

@pubkey
Copy link
Owner

pubkey commented Aug 10, 2021

RxDB since version 10 creates a separate IndexedDB for local documents and 'normal' documents.
The local documents indexeddb always has version 0.

@ofekd
Copy link
Author

ofekd commented Aug 10, 2021

I've added a failing test

2021-08-10-124330

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants