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

make sure that store.clear() aborts all pending requests #53

Open
gr2m opened this issue Dec 2, 2015 · 2 comments
Open

make sure that store.clear() aborts all pending requests #53

gr2m opened this issue Dec 2, 2015 · 2 comments

Comments

@gr2m
Copy link
Member

gr2m commented Dec 2, 2015

// sends bulk update request, or creates database if it does not exist yet
store.push()

// disconnects & cancels all requests from above and makes `hoodie.store.push()` reject its promise
store.clear()
@gr2m
Copy link
Member Author

gr2m commented Apr 18, 2016

we now call .disconnect() in .reset(). disconnect checks if there is an active replication and cancels it, but I see a potential issue when for example .pull and .push are called at the same time, as they both set state.replication. So .disconnect() will only cancel the last replication, but not the other

@gr2m
Copy link
Member Author

gr2m commented Apr 18, 2016

also .reset() calls PouchDB’s .destroy() method and I would expect that it’s cancelling all pending requests by itself

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

1 participant