Skip to content

Conversation

SkyZeroZx
Copy link
Contributor

@SkyZeroZx SkyZeroZx commented Jul 19, 2025

Add client notification when an app version fails, improving error visibility and debugging capabilities. When a version encounters a broken hash error, all clients using that version are now notified with details about the failure.

  • Add notifyClientsAboutVersionFailure method call in versionFailed
  • Ensure clients receive VERSION_FAILED events with error details
  • Improve service worker error transparency for better debugging

Complete previous TODO
New Usage :

this.swUpdate.versionUpdates.subscribe((event: VersionEvent) => {
      switch (event.type) {
        case 'VERSION_DETECTED':
          console.log('New version detected:', event.version.hash);
          break;
          
        case 'VERSION_READY':
          console.log('New version ready:', event.latestVersion.hash);
          // Optionally show update available notification
          break;
          
        case 'VERSION_INSTALLATION_FAILED':
          console.error('Version installation failed:', event.error);
          break;
          
        case 'VERSION_FAILED':
          // NEW: Handle version failure
          this.handleVersionFailure(event);
          break;
          
        case 'NO_NEW_VERSION_DETECTED':
          console.log('No new version available');
          break;
      }

@pullapprove pullapprove bot requested a review from kirjs July 19, 2025 22:27
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: service-worker Issues related to the @angular/service-worker package labels Jul 19, 2025
@ngbot ngbot bot added this to the Backlog milestone Jul 19, 2025
Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

reviewed-for: fw-general, public-api

@thePunderWoman thePunderWoman added the target: minor This PR is targeted for the next minor release label Jul 24, 2025
@pullapprove pullapprove bot requested review from devversion and JeanMeche July 24, 2025 10:08
Add client notification when an app version fails, improving error
visibility and debugging capabilities. When a version encounters a
critical error, all clients using that version are now notified
with details about the failure.

- Add notifyClientsAboutVersionFailure method call in versionFailed
- Ensure clients receive VERSION_FAILED events with error details
- Improve service worker error transparency for better debugging
@thePunderWoman thePunderWoman force-pushed the add-service-worker-event-failed branch from 5e8e0a0 to b67e039 Compare July 24, 2025 11:13
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public-api

@thePunderWoman thePunderWoman added the action: merge The PR is ready for merge by the caretaker label Jul 24, 2025
@thePunderWoman
Copy link
Contributor

This PR was merged into the repository by commit 6d01168.

The changes were merged into the following branches: main

@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 Aug 24, 2025
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 detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants