Skip to content

[PWA] Is it a good practice to set version in manifest tag? #4660

Open
@gbdematos

Description

@gbdematos

Version

3.11.0

Environment info

System:
    OS: Windows 10
    CPU: (4) x64 Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz
  Binaries:
    Node: 12.5.0 - C:\Develop\Laragon\bin\nodejs\node-v12\node.EXE
    Yarn: 1.17.3 - C:\Develop\Laragon\bin\yarn\bin\yarn.CMD
    npm: 6.9.0 - C:\Develop\Laragon\bin\nodejs\node-v12\npm.CMD
  Browsers:
    Edge: 44.18362.387.0

Hi!

When launching the app if already installed, the manifest is not updating, as seen here:
https://developers.google.com/web/fundamentals/integration/webapks#update-webapk

"Chrome will only update a WebAPK if the Web Manifest URL does not change. If you change the web page from referencing /manifest.json to reference /manifest2.json, the WebAPK will no longer update. (Don't do this!)"

As the assets version is attached to the tag ("manifest.json?v=1.1"), isn't it detected as a different file and not updated?

I'm having trouble with this, since I have an app and changed it icon, but id didn't update on any of the devices that has it installed.

Steps to reproduce

  1. Create 3 projects using vue-cli with pwa plugin.

  2. Create 2 sets of 192x192 and 512x512 images (I created a red and a green circle) and add the first set to all 3 manifest.json files.

  3. In projects number 1 and 3 leave the default config, without changing anything.

  4. In project number 2, configure vue.config.js like this:

pwa: {
    assetsVersion: '1.0'
}
  1. Deploy each project and install them to your homescreen. You'll have this as a result:

1st screen

  1. In all 3 projects, update the paths to the icons in manifest.json to the 2nd set of icons.

  2. In project number 2, update vue.config.js to this:

pwa: {
    assetsVersion: '2.0'
}
  1. In project number 3, change manifest.json name to manifest2.json and update vue.config.js to this:
pwa: {
    manifestPath: 'manifest2.json'
}
  1. Again, deploy all 3 projects.

  2. Wait for 1 or more days and then open the apps on your phone (it has to be connected to wi-fi and charging).

  3. Only project number 1 icons will update:

2nd screen

So, to me, this proves that adding the assets version to the manifest URL is in fact a bad practice, as the server seems to interpret it as a different manifest and this goes against chrome best practices:

Chrome will only update a WebAPK if the Web Manifest URL does not change. If you change the web page from referencing /manifest.json to reference /manifest2.json, the WebAPK will no longer update. (Don't do this!)


Edit: added steps to reproduce.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs team reproWe acknowledged your report and will soon try to reproduce it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions