Skip to content

Backport fixes from main to 21.1.x - #3854

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

armando-navarro wants to merge 4 commits into
angular:21.1.xfrom
armando-navarro:backport-fixes-21.1.x

Conversation

@armando-navarro

@armando-navarro armando-navarro commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

This brings fixes and docs from main to 21.1.x for the 21.1.0 release. 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

Docs

…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
armando-navarro and others added 3 commits December 2, 2026 23:48
* docs: add a unit testing guide

AngularFire had no testing guidance in docs/ or the README, and four
issues have asked for it.

docs/testing.md covers Vitest and Jest: real services built from
made-up options, three ways to replace AngularFire in a test, the
setups that do not work with their error text, and the resolver
file Jest 30 needs. The README links to it.

Fixes angular#3668

(cherry picked from commit 4627bab)
…mple (angular#3857)

* docs(database): fix objectVal/listVal docs and multiple instances example

- Swap the reversed descriptions of objectVal() and listVal(), and fix listVal() return type (Observable<T[]>) and parameter name (query)
- Update Reference to DatabaseReference in the convenience observable tables
- Fix options:? typo in the stateChanges table
- Use inject(FirebaseApp) in provideDatabase() in the Working with multiple instances example

* docs(database): use query param in list tables and clarify stateChanges

---------

Co-authored-by: Armando Navarro <adnavarro@google.com>
(cherry picked from commit 1256182)
@armando-navarro armando-navarro added comp: database Realtime Database (src/database). comp: docs Documentation. labels Dec 3, 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: database Realtime Database (src/database). comp: docs Documentation. 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.

2 participants