From 836094c072cb0f6cdbd35469ee02158667a9ba51 Mon Sep 17 00:00:00 2001 From: Jessica Janiuk <1596273+thePunderWoman@users.noreply.github.com> Date: Thu, 9 Apr 2026 11:46:28 -0700 Subject: [PATCH] fix(service-worker): resolve TS 6.0 compatibility for messageerror listener In standard DOM definitions (lib.webworker.d.ts), the messageerror event is typed as MessageEvent, which lacks the waitUntil property found on ExtendableMessageEvent. In modern versions of TypeScript (including TS 6.0), this causes compile-time overload resolution errors when the listener function is explicitly typed to expect ExtendableMessageEvent. --- MODULE.bazel | 2 +- MODULE.bazel.lock | 6 +++--- packages/service-worker/worker/src/driver.ts | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 972db8cdbaf0..6d8fb427357e 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -18,7 +18,7 @@ bazel_dep(name = "yq.bzl", version = "0.3.5") bazel_dep(name = "rules_angular") git_override( module_name = "rules_angular", - commit = "346e8fe8e51c743f44771def707ea3a2f10abbdd", + commit = "4dd1f9fc6844b40c0eda797b9b13c66746ce9564", remote = "https://github.com/angular/rules_angular.git", ) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index fdaf0843f2ec..13a56d0d6d9b 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -429,7 +429,7 @@ "@@aspect_rules_ts+//ts:extensions.bzl%ext": { "general": { "bzlTransitiveDigest": "dhTbv9E6UfT1WJmmu3ORRPO6AKFJvgBjBxu+BO+u1RY=", - "usagesDigest": "hse4E8LZCCOKzxmEk9v+p8j+9FpsigCcwHm6Bot/XbI=", + "usagesDigest": "NWH7+5pgAvEbgmU6ouNQyZgBSzUlAFimi1H43zTLxSY=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, @@ -447,8 +447,8 @@ "rules_angular_npm_typescript": { "repoRuleId": "@@aspect_rules_ts+//ts/private:npm_repositories.bzl%http_archive_version", "attributes": { - "version": "5.9.3", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "version": "6.0.2", + "integrity": "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==", "urls": [ "https://registry.npmjs.org/typescript/-/typescript-{}.tgz" ] diff --git a/packages/service-worker/worker/src/driver.ts b/packages/service-worker/worker/src/driver.ts index c01232a2e3bf..c48a63c230a2 100644 --- a/packages/service-worker/worker/src/driver.ts +++ b/packages/service-worker/worker/src/driver.ts @@ -212,9 +212,7 @@ export class Driver implements Debuggable, UpdateSource { this.scope.addEventListener('notificationclick', (event) => this.onClick(event)); this.scope.addEventListener('notificationclose', (event) => this.onClose(event)); this.scope.addEventListener('pushsubscriptionchange', (event) => - // This is a bug in TypeScript, where they removed `PushSubscriptionChangeEvent` - // based on the incorrect assumption that browsers don't support it. - this.onPushSubscriptionChange(event as PushSubscriptionChangeEvent), + this.onPushSubscriptionChange(event), ); this.scope.addEventListener('messageerror', (event) => this.onMessageError(event)); this.scope.addEventListener('unhandledrejection', (event) => this.onUnhandledRejection(event)); @@ -355,7 +353,7 @@ export class Driver implements Debuggable, UpdateSource { event.waitUntil(this.handlePushSubscriptionChange(event)); } - private onMessageError(event: MessageEvent): void { + private onMessageError(event: ExtendableMessageEvent): void { // Handle message deserialization errors that occur when receiving messages // that cannot be deserialized, typically due to corrupted data or unsupported formats. this.debugger.log(