Reputation: 105
I have a progressive web app and I wish to make changes to its manifest file like a change to its start_url, scope, icon, name and short_name. I wish to know, when is it that the updates to the progressive web app take place after making a change to its manifest? I tried the following to force update the web app on Chrome browser:
adb shell dumpsys jobscheduler | JOB.*91.*org.chromium.components.background_task_scheduler.BackgroundTaskJobService
adb shell cmd jobscheduler run -f com.android.chrome 91
to force an updateHowever, I wish to know what is the real criteria for update to the web app after a change to the manifest file is done? Please can someone attach a code snippet supporting the same, which may be specific to how Chrome implements it?
Upvotes: 2
Views: 1095
Reputation: 105
I did a deep dive, to know what exactly is the criteria for update of web app on changes to manifest file and I was able to find the relevant source code in the chromium code base which had the update logic. According to the latest chromium source code changes https://chromium-review.googlesource.com/c/chromium/src/+/1635860 , the update interval is set to 1 day (99% cases, where the apps may update more frequently) and 30 days (1% cases where the apps may update less frequently). Previously, it was set to 3 days ( 99% cases) and 30 days ( 1% cases). Also, there is an official documentation by Google https://developers.google.com/web/fundamentals/integration/webapks#update-webapk which says :
Chrome will periodically compare the locally installed manifest against a copy of the manifest fetched from the network. If any of the properties in the manifest required to add the PWA to the home screen have changed in the network copy, Chrome will request an updated WebAPK, reflecting those new values. There are a number of rules that govern how these update checks are triggered:
Validated the same already.
The code flow responsible for this update is given by follows :
Upvotes: 5