question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VersionReadyEvent UpdateInfo Property

See original GitHub issue

Which @angular/* package(s) are relevant/releated to the feature request?

service-worker

Description

Regarding VersionReadyEvent’s currentVersion and latestVersion objects, is it possible to have them contain a new property updateInfo: string so that we can use this updateInfo to customize or set the update notification text?

interface VersionReadyEvent { type: ‘VERSION_READY’ currentVersion: {…} latestVersion: {…} }

https://angular.io/api/service-worker/SwUpdate

import {filter, map} from 'rxjs/operators';
// ...
const updatesAvailable = swUpdate.versionUpdates.pipe(
  filter((evt): evt is [VersionReadyEvent](https://angular.io/api/service-worker/VersionReadyEvent) => evt.type === 'VERSION_READY'),
  map(evt => ({
    type: 'UPDATE_AVAILABLE',
    current: evt.currentVersion,
    available: evt.latestVersion,
  })));

Proposed solution

Regarding VersionReadyEvent’s currentVersion and latestVersion objects, is it possible to have them contain a new property updateInfo: string so that we can use this updateInfo to customize or set the update notification text?

Alternatives considered

Create an extra endpoint to set the update text

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gkalpakcommented, Feb 12, 2022

That’s a great idea, @Jun711 👍 Would you be up to creating a PR to update the docs? Alternatively, maybe you could create a GitHub issue to track this.

1reaction
Jun711commented, Feb 11, 2022

@gkalpak Thank you, it works. I suggest adding a link to SW Configuration page or creating a description page that describes what appData is so that users who read VersionReadyEvent and related pages can figure out what appData is without having to search

Read more comments on GitHub >

github_iconTop Results From Across the Web

SwUpdate
Property, Description ... Emits a VersionReadyEvent event whenever a new version has been downloaded and is ready for activation.
Read more >
Angular SwUpdate activated deprication
I believe activated and activateUpdate() are different things. You call activateUpdate() , then when it's done, activated happens.
Read more >
Where does entity_rules.json get generated? - IBM/Transition- ...
I trained a model according to the instructions, and it seems like there was a file entity_rules.json that was supposed to be generated....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found