Skip to content

feat(service-worker): add messageerror event handling and logging #62834

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SkyZeroZx
Copy link
Contributor

feat(service-worker): Add messageerror event handling and logging

Enables proper handling and logging of message deserialization errors in Angular Service Workers, improving error detection and debugging capabilities for corrupted or unsupported message formats.

The change includes:

  • Added messageerror event listener to the Driver class
  • Implemented onMessageError method for handling message deserialization errors
  • Added comprehensive unit tests to verify the new functionality
  • Updated test harness to support messageerror event simulation
  • Enhanced error logging with origin information for better debugging

Motivation/Use Cases

The messageerror event handling is particularly useful for:

  • Error Detection: Identifying when messages cannot be deserialized due to corrupted data
  • Debugging Support: Providing detailed logging information about message errors
  • Robust Error Handling: Gracefully handling unsupported message formats without breaking the service worker
  • Compliance with Service Worker Standards: Implementing the full messageerror event specification

Add messageerror event handling and logging to Driver class
@pullapprove pullapprove bot requested a review from mmalerba July 26, 2025 19:38
@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 26, 2025
@ngbot ngbot bot added this to the Backlog milestone Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: service-worker Issues related to the @angular/service-worker package detected: feature PR contains a feature commit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant