Background fetch silently fails |
|||||||||
Issue descriptionhttps://tests.peter.sh/random/background-fetch-content.html Press "start a background fetch" The background fetch successfully registers, but no service worker event are fired. 67.0.3379.0 (Official Build) canary (64-bit)
,
Mar 27 2018
Assigning to myself to investigate.
,
Apr 19 2018
Any update on this ?
,
Apr 27 2018
I'm using these websites to test: http://tests.peter.sh/random/background-fetch-content.html, and mugdhalakhani.github.io/bgf/bgf.html. Using developer tools consoles helps see errors and logs from JSP. I can't repro this on: 1. Latest master, both debug and release. 2. 66.0.3359.117: when I build it myself, both debug and release. 3. 68: when I build it myself, both debug and release. I can repro this on the Stable 66.0.3359.117 official build that I have installed. I can see that a BackgroundFetch registration is done, and a download job is created with the download manager, but we never get any progress events after that. I compared the official 66.0.3359.117 build where I had a repro with the same build compiled locally (release), and found that Guest and Incognito mode failed BGF fetch() consistently like this everywhere. Other than that, everything worked as expected, except my google.com account from the official build failed fetch() in a very similar way to Guest and Incognito modes. Removing all other accounts but this google.com account from "Manage People" didn't help fix the issue. One more experiment I tried was to launch chrome (Both the official and locally-compiled build) and create a new profile. When there was just one person, background fetch worked as expected. When I added a person, background fetch failed similarly to guest and incognito modes (one download would be started and never finish). Therefore, I feel this is a bug in DownloadManager relating to number of people added to Chrome. Assigning to Xing Liu to investigate further.
,
May 1 2018
chrome://download-internals shows an active download that never gets resolved: https://screenshot.googleplex.com/Q1X82eh8zVU
,
Aug 7
@xingliu, Were you able to look into this?
,
Aug 7
,
Aug 7
I think background download currently only works on Android. We have some hooks for desktop, but not sure if they actually works.
,
Aug 7
Is the testing site still available? the button to start fetch is disabled.
,
Aug 15
cc nator@ to see if I can get any help. I think this bug also blocks 863949 where in CL https://chromium-review.googlesource.com/c/chromium/src/+/1171594, some webkit layout test always fails. I guess the actual network request is not getting processed.
,
Aug 15
Background fetch works for both desktop and Android, it's the UI that's missing for Desktop. Regarding your attempt Xing, do you have the "experimental web platform features" flag enabled?
,
Aug 15
Thanks, I can repro this on Mac.
,
Aug 15
network/battery detection on Mac seems not working correctly. net::NetworkChangeNotifier seems doesn't work on Mac.. Issue 725485. base::PowerObserver also seems to be incorrect on Mac.
,
Aug 16
,
Aug 16
,
Aug 19
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3ea8bbe59eb418f6cfa906647231f461f54c0abc commit 3ea8bbe59eb418f6cfa906647231f461f54c0abc Author: Xing Liu <xingliu@chromium.org> Date: Sun Aug 19 22:19:39 2018 Background download: Network/battery status listener implementation on Mac. net::NetworkChangeNotifier and base::PowerObserver are not hooked to correct platform code on Mac, thus make background download service not working correctly. This CL provides default implementation for device status monitoring on Mac that always treat the device connected to internet and power source. This is mostly a temporary solution before platform code is implemented correctly. Also pull out BatteryStatusListener and NetworkStatusListener to a separate file. Bug: 825878 Change-Id: If34d8eb0cbe5d0575920c4251eda5e5161695adf Reviewed-on: https://chromium-review.googlesource.com/1178689 Reviewed-by: Min Qin <qinmin@chromium.org> Commit-Queue: Xing Liu <xingliu@chromium.org> Cr-Commit-Position: refs/heads/master@{#584345} [modify] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/content/factory/download_service_factory.cc [modify] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/BUILD.gn [modify] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/android/battery_status_listener_android.cc [modify] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/android/battery_status_listener_android.h [modify] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/android/network_status_listener_android.h [add] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/scheduler/battery_status_listener.h [add] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/scheduler/battery_status_listener_impl.cc [add] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/scheduler/battery_status_listener_impl.h [add] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/scheduler/battery_status_listener_mac.cc [add] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/scheduler/battery_status_listener_mac.h [modify] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/scheduler/device_status_listener.cc [modify] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/scheduler/device_status_listener.h [modify] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/scheduler/device_status_listener_unittest.cc [modify] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/scheduler/network_status_listener.cc [modify] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/scheduler/network_status_listener.h [add] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/scheduler/network_status_listener_impl.cc [add] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/scheduler/network_status_listener_impl.h [add] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/scheduler/network_status_listener_mac.cc [add] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/scheduler/network_status_listener_mac.h [modify] https://crrev.com/3ea8bbe59eb418f6cfa906647231f461f54c0abc/components/download/internal/background_service/test/test_device_status_listener.cc
,
Sep 27
This looks like it's fixed, no more repro, so closing. Thanks Xing! |
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by jakearchibald@chromium.org
, Mar 26 2018