High level information: https://web.dev/manifest-updates/
The manifest update process is required whenever a new manifest is served to an existing web_app, which would mean that the database entries corresponding to that web application needs to be updated. With the predictable app updating flag enabled, the following information sheds some light on how the manifest update system works in Chrome.
name, icon and short_name) require explicit user approval.Cache-Control:immutable behavior of HTML, where updates are triggered ONLY if the icon url has changed.This helps ensure:
Whenever the tab has kicked off a navigation to an url for a web_app, a check is kicked off to determine if a manifest update is required or not. The update process is aborted if the following conditions are satisfied:
Once the update is allowed to proceed, the following steps happen:
ManifestSilentUpdateCommand takes over to perform the following tasks:If the update requires user intervention, that is surfaced to the user in a non-blocking way by showing an expanded label saying App Update Available in a standalone app window. Apps running in a browser tab do not see that label.
Clicking that label triggers the three dot menu dropdown, that has a Review App Update entrypoint. Clicking on that triggers the WebAppUpdateReviewDialog, which shows the before and after state of the app. The metadata to show on the dialog is collected by the AppUpdateDataReadCommand.
The user can choose to either:
ApplyPendingManifestUpdateCommand is triggered which applies any pending updates to the metadata and icons.WebAppIntegrationTestDriver contains browser tests for the entire end-to-end working of the manifest update process. Please look at the critical user journeys and integration testing framework for more documentation on how to parse these tests.ManifestSilentUpdateCommandTest contains unit tests for the determination part of the manifest update operation that determines if the updates need to happen silently, or if pending data needs to be stored.ManifestSilentUpdateCommandBrowserTest contains browser tests for the determination part of the manifest update operation, that requires an active browser window to be available, for example, to check if the expanded label is available for pending updates.ApplyPendingManifestUpdateCommandTest contains unit tests for the application of pending updates to the web app database as well as icons stored on the disk.WebAppUpdateReviewDialogBrowserTests contains browser tests for the end to end flow, including the triggering of the dialog and verification of the expanded label available on the web app.