Skip to content

Backport fixes from main to 21.1.x - #3854

Draft
armando-navarro wants to merge 1 commit into
angular:21.1.xfrom
armando-navarro:backport-fixes-21.1.x
Draft

armando-navarro wants to merge 1 commit into
angular:21.1.xfrom
armando-navarro:backport-fixes-21.1.x

Conversation

@armando-navarro

Copy link
Copy Markdown
Collaborator

This brings fixes from main to 21.1.x for the 21.1.0 release. It holds one so far, and I may add more before it merges.

  • Each commit is a git cherry-pick -x of the squash commit on main, and each applied with no conflicts.
  • Will merge with Rebase and merge, so each fix stays its own commit on 21.1.x.

Fixes for v21 users

…ngular#3852)

Firebase's getMessaging() calls navigator.serviceWorker.addEventListener
without checking that navigator.serviceWorker exists. On a page that is
not a secure context, and in iOS in-app browsers, it does not exist, so
injecting Messaging threw and the app failed to bootstrap. Until 19.0.0
the providers awaited isSupported() and injected null there. angular#3588
removed that check.

Run the app's factory as before. When it throws and navigator has no
serviceWorker, inject null. Any other throw still propagates. Checking
before running the factory would have ignored a factory that returns its
own object, such as a test double under jsdom.

With two provideMessaging registrations both entries are then null, and
ɵgetDefaultInstanceOf read .app on them. Skip null entries there.

Fixes angular#3672
Refs angular#3630

(cherry picked from commit 07d7ee4)
@armando-navarro armando-navarro added bump: patch Size of the change: a fix or docs change that reaches users comp: core FirebaseApp DI core (src/app). comp: messaging Cloud Messaging / FCM (src/messaging). type: bug Defect: expected behavior doesn't happen. labels Nov 27, 2026
@armando-navarro armando-navarro added this to the 21.1.0 milestone Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bump: patch Size of the change: a fix or docs change that reaches users comp: core FirebaseApp DI core (src/app). comp: messaging Cloud Messaging / FCM (src/messaging). type: bug Defect: expected behavior doesn't happen.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant