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

store.findAll() return deleted items if pouchdb-browser is initialized with a low “revs_limit” and “auto_compaction: true” #890

Open
PiTomar opened this issue Nov 1, 2019 · 0 comments

Comments

@PiTomar
Copy link

PiTomar commented Nov 1, 2019

I initialize my hoodie/ pouchdb like this:

const PouchDB = require('pouchdb-browser');
const pouchdb = PouchDB.default.defaults({ revs_limit: 1, auto_compaction: true });

const Hoodie = require('@hoodie/client');
const hoodie = new Hoodie({
            url: someURL,
            PouchDB: pouchdb   
});

When I delete an element with store.remove I experience the following behavior:

  • The store.remove promise does never resolve or reject.
  • When I inspect the indexedDB (with chrome-dev-tools) for the element I want to be deleted , I see a new revision of this element.
  • This is also correctly marked as deleted (delete date set).
    Old revisions are still not deleted (but this is probably a pouchdb bug discussed here: revs_limit hides, but does not actually delete, old document data pouchdb/pouchdb#4372)
  • However, when I do a store.findAll() the deleted element is still returned respectively to be more specific: the previous revision of the "deleted" element is returned.

When I set the pouch-db revs_limit e.g to 5 it seems to work.

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
@PiTomar and others