BackgroundSync event fires when offline under VirtualBox VM
Reported by
pkoniec...@hotmail.com,
Jan 19 2018
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 Steps to reproduce the problem: 1. Open demo at https://deanhume.github.io/Service-Workers-BackgroundSync/ 2. Open DevTools 3. Switch to Airplane mode or turn off internet connection 4. Click on button 'Make an HTTP request - do it!' What is the expected behavior? Sync event is scheduled for later, until internet connection is available again. Then service worker executes fetch which is part of sync callback What went wrong? Sync event is fired immediately and fetch fails as there is no internet connection with error TypeError: Failed to fetch Did this work before? N/A Chrome version: 63.0.3239.132 Channel: stable OS Version: 10.0 Flash Version: Works as expected in Chrome Mobile in Android emulator. Windows 10 is updated to latest version (1709, build 16299.12), Chrome is updated to latest stable version.
,
Jan 19 2018
,
Jan 21 2018
This is caused by using VirtualBox, which is creating new Virtual Ethernet Adapters. When I disabled all "VirtualBox Host-Only Network" connections, the issue was gone and browser evaluated connection state as offline. However I'm not sure if it resolves the issue as it means that BackgroundSync won't work for anybody that has installed VirtualBox, any programs that use it (Genymotion, Vagrant) or possibly any other virtualization software. During development I can temporarily disable VirtualBox connections but when other user logs in into same machine, BackgroundSync won't work for him/her.
,
Jan 22 2018
,
Jan 22 2018
Unable to reproduce the issue on reported chrome version 63.0.3239.132 and on the latest canary 66.0.3327.0 using Windows 10 with the below mentioned steps. 1. Launched Chrome 2. Navigated to https://deanhume.github.io/Service-Workers-BackgroundSync/ 3. Opened Devtools then Clicked on button "Make an HTTP request - do it!". 4. Disconnected internet connection and did step#3 again. We observed the sync event is scheduled for later. Attaching the screenshot of the same. @Reporter: Could you please look at the screenshot and let us know if we have missed any steps while reproducing the issue. Any further inputs from your end may help us. Thanks!
,
Jan 22 2018
As stated in my previous comment https://bugs.chromium.org/p/chromium/issues/detail?id=803803#c3 the issue is caused by Virtual Ethernet Adapter installed by VirtualBox or other products that use it. So there's additional step: Install Genymotion or Vagrant As long as such network connections stay enabled in Windows control panel, browser never enters offline state (navigator.onLine is always true) and BackgroundSync always triggers sync event immediately.
,
Jan 22 2018
Thank you for providing more feedback. Adding requester "vamshi.kommuri@techmahindra.com" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jan 23 2018
One solution could be to evaluate network connection state as offline there are no active network connections or only connections that use virtual adapters are enabled and add special flag in chrome://flags to override this behavior. By the way: at the moment Firefox is behaving similarly as Chrome.
,
Jun 6 2018
As per comment#6 this seems to be specific to Virtual Ethernet Adapter installed by VirtualBox. As TE team do not have this setup as of now adding TE-NeedsTriageHelp label for further investigation from dev team. Could someone from Blink>BackgroundSync team please have a look at this issue. Thanks!
,
Aug 18
navigator.online is not full proof which is explained in comment#3 (https://bugs.chromium.org/p/chromium/issues/detail?id=803803#c3). I think the better approach can be using the ononline and onoffline attribute for body tag. They work pretty amazingly and fast. Values are supposed to be function. <body ononline="whenOnline()" onoffline="whenOffline()"> |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by pkoniec...@hotmail.com
, Jan 19 2018