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

dropAllDatabases does not respect experimentalCreateKVStore #1057

Open
NavaceSystem opened this issue Jun 8, 2024 · 3 comments
Open

dropAllDatabases does not respect experimentalCreateKVStore #1057

NavaceSystem opened this issue Jun 8, 2024 · 3 comments

Comments

@NavaceSystem
Copy link

"replicache": "14.2.2",

We are trying to use replicache in react-native using the experimentalCreateKVStore with https://github.com/Braden1996/react-native-replicache binding. Everything works fine except for the the dropAllDatabases and dropDatabase calls. It seems to be ignoring the binding and doing its default "web" stuff. I've traced the minified Replicache code to debug this and below are 2 errors that made me reach this conclusion:

  • When calling dropAllDatabases, it errors out on this line in replicache return navigator.userAgent.includes("Firefox"). It obviously has some FF specific logic but this code shouldn't be running at all. When the experimentalKVStore is present it should be calling its destroy function.
  • If I hard code the above to be false, it continues to error out at indexedDB.deleteDatabase(t). Again IDB is a web specific thing, it shouldn't be running this code at all.
@aboodman
Copy link
Contributor

I think this is fixed in Replicache 15. We started releasing this and didn't complete it. I can't remember why. Can you take a look?

@1kDustin
Copy link

@NavaceSystem This does seem to work in react native on Replicache 15, but Replicache seems to continue to try and sync once the DB is destroyed. Calling replicache.close() before destroying the DB results in breaking destroyAllDatabases, so I think we're kind of stuck until this one gets figured out

@aboodman
Copy link
Contributor

@1kDustin do you have a reproduction or test case that shows what you're seeing? Thanks!

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

3 participants