Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(service-worker): detect new version even if files are identical to an old one #26006

Closed

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Sep 18, 2018

PR Checklist

PR Type

[x] Bugfix

What is the current behavior?

If an app version (aka manifest) contains the same files as an older version (e.g. making a change, then rolling it back), the SW would not detect it as the latest version (and update clients).

Issue Number: #24338

What is the new behavior?

A new timestamp field is added in ngsw.json (based on the current date), which makes each build unique (with sufficiently high probability).

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Fixes #24338.

@gkalpak gkalpak requested a review from alxhub September 18, 2018 21:18
@gkalpak gkalpak added type: bug/fix action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release area: service-worker Issues related to the @angular/service-worker package labels Sep 18, 2018
@mary-poppins
Copy link

You can preview d12a118 at https://pr26006-d12a118.ngbuilds.io/.

@gkalpak gkalpak force-pushed the fix-sw-detect-rollback-as-new-version branch from d12a118 to ca19ce5 Compare January 16, 2019 15:25
@gkalpak gkalpak requested a review from a team as a code owner January 16, 2019 15:25
@mary-poppins
Copy link

You can preview ca19ce5 at https://pr26006-ca19ce5.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 79fa1bc at https://pr26006-79fa1bc.ngbuilds.io/.

@gkalpak gkalpak force-pushed the fix-sw-detect-rollback-as-new-version branch from 79fa1bc to 94ad278 Compare January 16, 2019 15:59
@mary-poppins
Copy link

You can preview 94ad278 at https://pr26006-94ad278.ngbuilds.io/.

@ngbot ngbot bot added this to the needsTriage milestone Jan 16, 2019
@IgorMinar IgorMinar added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 5, 2019
@IgorMinar IgorMinar removed the request for review from alxhub March 5, 2019 07:03
@IgorMinar
Copy link
Contributor

@gkalpak can you please rebase this to get rid of the pending pullapprove status? thanks

…o an old one

Previously, if an app version contained the same files as an older
version (e.g. making a change, then rolling it back), the SW would not
detect it as the latest version (and update clients).

This commit fixes it by adding a `timestamp` field in `ngsw.json`, which
makes each build unique (with sufficiently high probability).

Fixes angular#24338
@gkalpak gkalpak force-pushed the fix-sw-detect-rollback-as-new-version branch from 94ad278 to b158057 Compare March 5, 2019 13:24
AndrewKushnir pushed a commit that referenced this pull request Mar 5, 2019
…o an old one (#26006)

Previously, if an app version contained the same files as an older
version (e.g. making a change, then rolling it back), the SW would not
detect it as the latest version (and update clients).

This commit fixes it by adding a `timestamp` field in `ngsw.json`, which
makes each build unique (with sufficiently high probability).

Fixes #24338

PR Close #26006
@gkalpak gkalpak deleted the fix-sw-detect-rollback-as-new-version branch March 5, 2019 18:08
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: service-worker Issues related to the @angular/service-worker package cla: yes risk: low target: patch This PR is targeted for the next patch release type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Service worker does not fetch new version of the app if the version is same as a previous version
5 participants