Eleven wrapped callbacks and remote-config `isSupported` hold the app unstable until something that may never happen
Mantenedores costumam responder em até 3 dias
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- angular, firebase, typescript
Direção de pesquisa
Start with the ɵzoneWrap configuration and the generation rules in tools/build.ts, then compare the wrapped callbacks and remote-config isSupported with the existing onMessage and analytics or messaging entries. Check generated exports and tests for callback task handling and isSupported; done means the listed callbacks no longer block stability when their first event is not guaranteed, while callbacks still run in Angular context, and remote-config isSupported is generated with blockUntilFirst: false.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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 runs or the returned unsubscribe is called.
That 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:
onLogfrom@angular/fire/app: never stable until some Firebase SDK logs, which a quiet app never does. It returnsvoid, so no unsubscribe can release the task either.onTokenChangedfrom@angular/fire/app-check: never stable until a token is obtained. With the setupdocs/app-check.mdshows (noisTokenAutoRefreshEnabled), a first visit that makes no protected request never obtains one.onChildAddedfrom@angular/fire/database: never stable on an empty node. A new listener's initial events are onlychild_added, one per existing child, andvalue.onChildChanged,onChildMoved,onChildRemovedfrom@angular/fire/database: never stable until someone changes, moves or removes a child. None of them fires on attach.off(query, eventType, callback)from@angular/fire/database: never stable. It never calls the callback it is given and returnsvoid.enableLogging(fn)from@angular/fire/database: never stable until the database SDK logs something.fromRefon a child event, andstateChangesandauditTrailwith their default events, from@angular/fire/database: never stable on an empty node. They emit only on child events, so the taskpendingUntilEventregistered is never released.
isSupported from @angular/fire/remote-config is a twelfth case with a different cause:
- Its promise settles when an IndexedDB check answers, so a browser that never answers holds the app for good.
- #3613 added
isSupported: { blockUntilFirst: false }for it, matching the analytics and messaging copies, but in therxfire/remote-configblock oftools/build.ts, which exports noisSupported. The generator ignored the entry and remote-config shippedtrue. - #3759 deleted the dead entry and left the move for a follow-up.
How to reproduce these conditions
On 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:
onLog,onTokenChanged(provider with no token, no auto refresh),onChildAddedon an empty node,onChildChanged,onChildMovedandonChildRemovedon 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.onChildAddedon a node with three children,onValue,onSnapshotsInSync,onTokenChangedwith auto refresh on: unstable from 0 ms, stable again within 2 to 23 ms when the callback ran.- With
false: no task registered, and inside the callbackinject()still works and, under zone.js,NgZone.isInAngularZone()is still true.
A 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.
For 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.
Expected behavior
A 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.
Actual behavior
All twelve are wrapped with blockUntilFirst true.
- Linguagem predominante
- TypeScript
- Estrelas
- 7.8k
- Forks
- 2.2k
- Merge médio
- 2d 14h
- PRs com merge (30d)
- 26
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de angular/angularfire
-
comp: compat comp: firestore comp: storage type: chore
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
angular/angularfire#3822 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 55/100
angular/angularfire#3800 · 1 reação ·
Mantenedores costumam responder em até 3 dias
-
Use `TransferState` to hand server-rendered Firestore data to the browser, instead of reading every document twiceTalvez livre de novo @armando-navarro assumiu há 60 dias e não há nenhum pull request aberto. Abertacomp: firestore comp: ssr priority: P0 (critical) type: feature version: current (v17+)
angular/angularfire#3757 · 1 responsável ·
Mantenedores costumam responder em até 3 dias
-
Six `firebase` entry points have no `@angular/fire` equivalent, so their exports are unreachableTalvez livre de novo @armando-navarro assumiu há 60 dias e não há nenhum pull request aberto. Abertacomp: core type: feature
angular/angularfire#3755 · 1 responsável ·
Mantenedores costumam responder em até 3 dias
-
Angular 22 release pleaseAberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
angular/angularfire#3737 · 4 comentários · 24 reações ·
Mantenedores costumam responder em até 3 dias
Todas as issues de angular/angularfire
Issues semelhantes
-
helm-knative-apply.sh fails with Helm 4Talvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertaarea: triage theme: undefined
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
jhipster/generator-jhipster#35895 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
paperclipai/paperclip#18396 ·
Mantenedores costumam responder em até 1 dia
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
lingdojo/kana-dojo#33380 · 1 comentário · 5 reações ·
Mantenedores costumam responder em até 1 dia
-
chore other
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
alastair-smith/card-games#342 ·
Mantenedores costumam responder em até 1 dia