Hi I also work on the WebAPK team. I wrote most of the update logic so hopefully I can help. Thank you very much for reaching out. It seems that you have identified some things that we need to improve.
I am including as much information as possible for the sake of completeness. I know that I am repeating some of what Glenn has said.
- We check for WebAPK updates when a WebAPK is launched. We don't check for updates when Chrome is launched
- We check for updates either every 3 days or every 30 days. Checking for updates every 3 days is the 99% case. We switch to the 30 day interval in some unlikely cases where the update server cannot provide an update (According to Glenn's logs you don't seem to be in the 30 day bucket)
- Clearing Chrome's data (via "CLEAR ALL DATA" in Android settings) resets the update timer.
- We will only update a WebAPK if the Web Manifest URL does not change. If you change the web page from referencing <link rel="manifest.json"> to reference <link rel="manifest2.json"> the WebAPK will no longer update
- We will only update a WebAPK if the WebAPK is not running (moving the WebAPK to the background is not good enough)
- We will only update WebAPKs if the WebAPK was created by an official version of Chrome (Stable/Beta/Dev/Canary). It does not work with Chromium. (
org.chromium.chrome)
Example:
Jan 1 -> Install WebAPK
Jan 1 -> Launch WebAPK -> No update check
Jan 2 -> Launch WebAPK -> No update check
Jan 4 -> Launch Chrome -> No update check (Launching Chrome has no effect)
Jan 4 -> Launch WebAPK -> Check whether update is needed
Jan 6 -> Clear Chrome's data
Jan 9 -> Launch WebAPK -> No update check (From Chrome's perspective this is the first WebAPK launch)
Jan 12 -> Launch WebAPK -> Check whether update is needed
How to test for WebAPK updates:
Testing updates is easiest on an Android M device (or newer)
1) Launch WebAPK
2) Close the WebAPK
3) Modify the Web Manifest
4) Advance Android's system time by 3 days.
On my device: Settings>System>Date & Time>Set date
5) Launch WebAPK, wait a few seconds
6) Run adb shell dumpsys jobscheduler | JOB.*91.*org.chromium.components.background_task_scheduler.BackgroundTaskJobService
Check that the output is not empty
7) Close the WebAPK
to force an update
(If you don't force an update, the update will occur sometime in the next 24 hours when your device is idle)
Debugging WebAPK updates is easier if your phone is rooted. Your comments have convinced me that we need to make debugging updates easier if your phone is not rooted. I have filed http://crbug.com/815282 where you can follow along if you wish. I am hoping that these improvements will make be in Chrome 66 which is targetted for release at the end of April.
Please let me know if you have any luck,
- Peter