New issue
Advanced search Search tips

Issue 825878 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 27
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug

Blocking:
issue 863949



Sign in to add a comment

Background fetch silently fails

Project Member Reported by jakearchibald@chromium.org, Mar 26 2018

Issue description

https://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)
 
Labels: OS-Mac
Happens on on Mac, works fine on Android.

Comment 2 by na...@chromium.org, Mar 27 2018

Cc: peter@chromium.org
Owner: na...@chromium.org
Status: Assigned (was: Untriaged)
Assigning to myself to investigate.
Any update on this ?

Comment 4 by na...@chromium.org, Apr 27 2018

Owner: xingliu@chromium.org
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.

Comment 5 by na...@chromium.org, May 1 2018

chrome://download-internals shows an active download that never gets resolved: https://screenshot.googleplex.com/Q1X82eh8zVU
Labels: BlocksMVP
@xingliu, Were you able to look into this?
Status: Started (was: Assigned)
I think background download currently only works on Android. We have some hooks for desktop, but not sure if they actually works.
Is the testing site still available? the button to start fetch is disabled.
Blockedon: 863949
Cc: na...@chromium.org
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.
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?
Thanks, I can repro this on Mac.
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.
Blocking: 863949
Blockedon: -863949
Project Member

Comment 16 by bugdroid1@chromium.org, 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

Status: Fixed (was: Started)
This looks like it's fixed, no more repro, so closing. Thanks Xing!

Sign in to add a comment