Title: Eleven wrapped callbacks and remote-config `isSupported` hold the app unstable until something that may never happen · Issue #3826 · angular/angularfire · GitHub
Open Graph Title: Eleven wrapped callbacks and remote-config `isSupported` hold the app unstable until something that may never happen · Issue #3826 · angular/angularfire
X Title: Eleven wrapped callbacks and remote-config `isSupported` hold the app unstable until something that may never happen · Issue #3826 · angular/angularfire
Description: Version info Angular: 22.2 Firebase: 12.19.0 AngularFire: 22.0.0-rc.0, and main Description ɵzoneWrap registers an Angular pending task as soon as a wrapped function is passed a callback, and releases it only when that callback first run...
Open Graph Description: Version info Angular: 22.2 Firebase: 12.19.0 AngularFire: 22.0.0-rc.0, and main Description ɵzoneWrap registers an Angular pending task as soon as a wrapped function is passed a callback, and relea...
X Description: Version info Angular: 22.2 Firebase: 12.19.0 AngularFire: 22.0.0-rc.0, and main Description ɵzoneWrap registers an Angular pending task as soon as a wrapped function is passed a callback, and relea...
Opengraph URL: https://github.com/angular/angularfire/issues/3826
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Eleven wrapped callbacks and remote-config `isSupported` hold the app unstable until something that may never happen","articleBody":"### Version info\n\n**Angular:** 22.2\n\n**Firebase:** 12.19.0\n\n**AngularFire:** 22.0.0-rc.0, and `main`\n\n### Description\n\n`ɵzoneWrap` registers an Angular pending task as soon as a wrapped function is passed a callback, and releases it only when that callback first runs or the returned unsubscribe is called.\n\nThat is right for `onValue`, `onSnapshotsInSync` and `onAuthStateChanged`, which deliver a first value on attach. Eleven wrapped calls take a callback that a normal page load may never run, in which case `ApplicationRef.isStable` would stay `false` for good:\n\n- `onLog` from `@angular/fire/app`: never stable until some Firebase SDK logs, which a quiet app never does. It returns `void`, so no unsubscribe can release the task either.\n- `onTokenChanged` from `@angular/fire/app-check`: never stable until a token is obtained. With the setup `docs/app-check.md` shows (no `isTokenAutoRefreshEnabled`), a first visit that makes no protected request never obtains one.\n- `onChildAdded` from `@angular/fire/database`: never stable on an empty node. A new listener's initial events are only `child_added`, one per existing child, and `value`.\n- `onChildChanged`, `onChildMoved`, `onChildRemoved` from `@angular/fire/database`: never stable until someone changes, moves or removes a child. None of them fires on attach.\n- `off(query, eventType, callback)` from `@angular/fire/database`: never stable. It never calls the callback it is given and returns `void`.\n- `enableLogging(fn)` from `@angular/fire/database`: never stable until the database SDK logs something.\n- `fromRef` on a child event, and `stateChanges` and `auditTrail` with their default events, from `@angular/fire/database`: never stable on an empty node. They emit only on child events, so the task `pendingUntilEvent` registered is never released.\n\n`isSupported` from `@angular/fire/remote-config` is a twelfth case with a different cause:\n\n- Its promise settles when an IndexedDB check answers, so a browser that never answers holds the app for good.\n- #3613 added `isSupported: { blockUntilFirst: false }` for it, matching the analytics and messaging copies, but in the `rxfire/remote-config` block of `tools/build.ts`, which exports no `isSupported`. The generator ignored the entry and remote-config shipped `true`.\n- #3759 deleted the dead entry and left the move for a follow-up.\n\n### How to reproduce these conditions\n\nOn a fresh Angular 22 app with `@angular/fire@next`, wrap each real function with `ɵzoneWrap` at `true` (the generated line), call it the way a constructor does, inside the Angular zone and an injection context, against the Database and Firestore emulators, and record every `ApplicationRef.isStable` emission:\n\n- `onLog`, `onTokenChanged` (provider with no token, no auto refresh), `onChildAdded` on an empty node, `onChildChanged`, `onChildMoved` and `onChildRemoved` on a node with three children: unstable from 0 ms, still unstable at 3 seconds, callback never ran. Same in a zone.js app and a zoneless one.\n- `onChildAdded` on a node with three children, `onValue`, `onSnapshotsInSync`, `onTokenChanged` with auto refresh on: unstable from 0 ms, stable again within 2 to 23 ms when the callback ran.\n- With `false`: no task registered, and inside the callback `inject()` still works and, under zone.js, `NgZone.isInAngularZone()` is still true.\n\nA fresh Angular 22 SSR app that registers an `onLog` handler inside `provideAppInitializer`: with `onLog` imported from `@angular/fire/app`, `ng build` fails after about 30 seconds, the route extractor's timeout, with `Routes extraction was aborted. TimeoutError: The operation was aborted due to timeout`. With the identical file importing from `firebase/app`, it builds in about 2 seconds. That is the failure #3748 reported for `beforeAuthStateChanged`.\n\nFor `isSupported`: `true` holds the app unstable until the IndexedDB check answers, and for the whole window when `indexedDB.open` is stubbed to never fire. `false` registers no task. Inside the caller's `.then`, `inject()` throws and the zone is the one that attached the `.then`, at both values.\n\n### Expected behavior\n\nA wrapped call whose first callback is not guaranteed by subscribing does not hold the application unstable, as `onMessage`, `onRegistered`, `onUnregistered` and `beforeAuthStateChanged` already do not. `isSupported` from `@angular/fire/remote-config` is wrapped like the analytics and messaging copies.\n\n### Actual behavior\n\nAll twelve are wrapped with `blockUntilFirst` true.\n","author":{"url":"https://github.com/armando-navarro","@type":"Person","name":"armando-navarro"},"datePublished":"2026-10-29T23:03:03Z","url":"https://github.com/angular/angularfire/issues/3826"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6985e03c-223b-e797-02d3-01812e4432a7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D7B8:1EDA:CE7926:11314B4:6B035C32 |
| html-safe-nonce | ef87b2745591390d6074aae2ad1b9b024a97141a0d5da906976496622ea31ebd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0I4OjFFREE6Q0U3OTI2OjExMzE0QjQ6NkIwMzVDMzIiLCJ2aXNpdG9yX2lkIjoiMjAzNDk2NDEzMDkzNDUxMjY5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b93580069264f4f63c216e62e9090d3aa7b93c2d72549af67abb3005236f9ba6 |
| hovercard-subject-tag | issue:6110004687 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angularfire/3826/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f0edaa7096d0b31c9ed255cdaaba249a4d51ca48c6d336f804b8f6c825f84437/angular/angularfire/issues/3826 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f0edaa7096d0b31c9ed255cdaaba249a4d51ca48c6d336f804b8f6c825f84437/angular/angularfire/issues/3826 |
| og:image:alt | Version info Angular: 22.2 Firebase: 12.19.0 AngularFire: 22.0.0-rc.0, and main Description ɵzoneWrap registers an Angular pending task as soon as a wrapped function is passed a callback, and relea... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | armando-navarro |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angularfire git https://github.com/angular/angularfire.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 49453413 |
| octolytics-dimension-repository_nwo | angular/angularfire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49453413 |
| octolytics-dimension-repository_network_root_nwo | angular/angularfire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width