-
Notifications
You must be signed in to change notification settings - Fork 34
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
Race condition on error handling #15
Comments
Sounds like a race condition with the worker. That's really weird; I thought I waited for the worker to initialize before sending out any messages. I don't have time to look into this right now, so any PRs would be happily accepted. :) |
Actually yeah, that makes exactly zero sense because the browser is supposed to handle this automatically when I call Could this be a bug in Chrome? Can you reproduce in Firefox as well? |
I can't reproduce in Firefox, just Chromium (v49). Good call. |
Hm, if you can find a minimally reproducible test case, this might be a good bug to file on Firefox itself. In theory all webworker postMessage()s are ordered (both to and from the web worker). If Firefox behaves differently from Chrome (and Edge/Safari), then this could be a useful bug to send to Mozilla (they are very fast to fix bugs in my experience). |
I seem to have the same issue in my project. (Running Chrome v53 in electron.io, can't easily try out any other browser) |
Got it to work now in my case: Turned out that delaying the first call of db.get until db.info was finished did the trick. |
I came across the same issue in an angular2 project. The comment above helped me solve my issue. |
If I try to get a doc that doesn't exist immediately on page load I get an uncaught exception in promise. If I try to get the same doc after a 1 second delay then the error is handled as expected. If I remove worker-pouch the 404s are handled as expected.
I've done some digging around to try and get more information but unfortunately I haven't gotten far, but here's what I have...
I'm not sure if it's relevant but I use angular-pouchdb.
Let me know if there's anything else I can do to help.
The text was updated successfully, but these errors were encountered: