Dexie Sync from Service Worker fails on Chrome Version 55.0.2883.87 m.
Exception:
Unhandled rejection: OpenFailedError: OpenFailedError
globalError @ Promise.js:856
(anonymous) @ Promise.js:580
finalizePhysicalTick @ Promise.js:579
callListener @ Promise.js:496
endMicroTickScope @ Promise.js:568
physicalTick @ Promise.js:541
Here is the sample page setup to demo the issue (has nodejs backed sync server):
Link: Service Worker(See the console for errors)
The above works fine in earlier versions of Chrome and Firefox.
Also the same code when run from page works fine on Chrome Version 55.0.2883.87 m too.
Link: Sync from page
I tried to test this in the browser but unfortunately the links do not work anymore..
That's a workspace on C9, the service was down. I have made that up and running.
Thanks @puhazh, I could verify it fails on Chrome but not on FF. Could you do me a favour and add a line
Dexie.debug = true;
...after having required dexie?
That way we might be able to follow the flow that preceded the error.
Edit: Corrected Dexie.debug = 'true' to Dexie.debug = true. However, 'true' works as well.
Might be related: https://bugs.chromium.org/p/chromium/issues/detail?id=671588
WebSockets don't seem to work correctly in newer Chrome versions. Since the socket seems to fail, this issue https://github.com/dfahlander/Dexie.js/issues/434 seems to become relevant.
@dfahlander I have added Dexie.debug= 'true' in both the service worker JS file and the page JS file. You might need to terminate the service worker (from the dev tools->Application tab->Clear Storage or from chrome://serviceworker-internals, so that it starts with the updated version.
Thanks! The long stack now showed me that ws.onerror was triggered. Seems @nponiros is right that it is related to https://bugs.chromium.org/p/chromium/issues/detail?id=671588
Thank you @dfahlander @nponiros . Will keep a tab on the chrome issue, will test the same once the fix is released and will update the results here.
Tested on Google Chrome Dev Channel Version 57.0.2986.0, Dexie Sync from Service Worker works fine as expected.
@puhazh nice. Thanks for the feedback.
Most helpful comment
Thank you @dfahlander @nponiros . Will keep a tab on the chrome issue, will test the same once the fix is released and will update the results here.