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

indexeddb adapter: Unable to add key to index 'seq' #8599

Open
rgraddy opened this issue Feb 10, 2023 · 7 comments
Open

indexeddb adapter: Unable to add key to index 'seq' #8599

rgraddy opened this issue Feb 10, 2023 · 7 comments

Comments

@rgraddy
Copy link

rgraddy commented Feb 10, 2023

Issue

I'm using CouchDB remotely, PouchDB locally. I've been using the PouchDB idb adapter for a long time. I recently switched to the indexeddb adapter so I can use the purge function, but I'm running into a problem with the indexeddb adapter.

When my application initializes, it replicates N number of documents from CouchDB->PouchDB. I specify N via a configuration parameter. The initial replication is one-way and is successful regardless of the number of documents replicated. If N is <= 1000, after replication I can locally add documents and update documents to PouchDB without issue. However, if N is > 1000, after replication I get an error from the indexeddb adapter whenever I try to add or update a document locally. I'm using PouchDB 8.0. Here's the error:

image

Info

  • Environment: (browser)
  • Platform: (Chrome)
  • Adapter: (indexeddb)
  • Server: (CouchDB)
@gpetrov
Copy link

gpetrov commented Jul 19, 2023

Have the same issue, seems to be Chrome specific thought, in Edge 114, seems to works fine

@gpetrov
Copy link

gpetrov commented Aug 22, 2023

This is really annoying issue that happens now in all browsers and the only way to solve it is to delete the indexeddb database and start over again

@rgraddy
Copy link
Author

rgraddy commented Aug 22, 2023

Deleting the database won't solve it for me. When my app initializes, it could be replicating more than 1000 documents from the remote database. In that case, the database is immediately unusable due to the indexeddb adapter issue. I had to fall back to using the idb adapter.

@gpetrov
Copy link

gpetrov commented Aug 23, 2023

That makes the indexeddb adapter unusable for us as well, so we will be switching to the old idb adapter which doesn't have this problem

@garethbowen
Copy link
Member

@rgraddy @gpetrov This is definitely a bug but nobody is assigned to look into it right now. Do you have some time to narrow it down? For example, a unit test or script which reproduces the error would really help in resolving this.

@gpetrov
Copy link

gpetrov commented Dec 18, 2023

@garethbowen maybe this fixes it? #8495

We desperately need more regular fixes and PouchDB releases here - latest release is 8.0.1 from 10 months ago ...

@garethbowen
Copy link
Member

Could you try it and verify?

Agreed more releases would be better. There's quite a large improvement that's being worked on. Once that lands a release will come out.

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