pouchdb-hoodie-api icon indicating copy to clipboard operation
pouchdb-hoodie-api copied to clipboard

Tests fail with [email protected]

Open gr2m opened this issue 10 years ago • 8 comments

follow up for https://github.com/hoodiehq/pouchdb-hoodie-api/pull/75#issuecomment-139851044

Just checked it locally and could reproduce it with [email protected], but not with 4.0.1. @nickcolley are you looking into this already? It must have be something with the db.destroy() call here: https://github.com/hoodiehq/pouchdb-hoodie-api/blob/master/clear.js#L11

gr2m avatar Sep 15 '15 19:09 gr2m

fyi: https://github.com/pouchdb/pouchdb/issues/4339

gr2m avatar Sep 15 '15 20:09 gr2m

@gr2m think it's todo with the stateless constructor but yeah I ran into the same thing.

NickColley avatar Sep 15 '15 21:09 NickColley

Okay, so a way around this would be to re-initialize the db instance on destroy. In the hoodie API, we don't have the option to manually re-initialize the hoodie.store API, so it must happen auto-magically :tm:

No idea how though

gr2m avatar Sep 16 '15 16:09 gr2m

Is there a an alternative to db.destroy without performance issues in PouchDB?

gr2m avatar Sep 16 '15 18:09 gr2m

We have:

  • https://github.com/marten-de-vries/pouchdb-erase - Loops over all docs and deletes them (Don't think this'll work)
  • https://github.com/pouchdb/pouchdb/issues/802 - Purge, not currently implemented but a highly requested feature, this is what I think hoodie needs for a non-hacky solution.

Unless we can implement purge I'd think we'd have to re instantiate the database ourselves.

NickColley avatar Sep 17 '15 09:09 NickColley

Okay, we throw an error in PouchDB now, so this will mean this test wont hang any more.

NickColley avatar Feb 24 '16 15:02 NickColley

could you check locally? Is the new PouchDB version out yet?

gr2m avatar Feb 24 '16 15:02 gr2m

No, it's not released yet. But 5.3.0 should have the fix.

nolanlawson avatar Feb 25 '16 16:02 nolanlawson