Angular: injectMutation skips pending state when triggered in constructor or ngOnInit
Mantenedores costumam responder em até 1 dia
@benjavicente já está trabalhando nisso.
Desde 2/10/2026.
- #9098 de @ThiloAschebrock — fechado sem integrar
Avaliação
Esta issue ainda não foi avaliada.
Descrição
Describe the bug
useMutation does indicate a pending state and remains idle until the mutation concludes if triggered in a Component constructor or ngOnInit lifecycle method, whereas triggering the mutation from ngAfterContentInit works as expected.
Your minimal, reproducible example
https://stackblitz.com/edit/angular-query-aqv6yuzm?file=src%2Fmain.ts
Steps to reproduce
- Refresh the page.
- Observe the state changes for the three mutations triggered in an Angular
constructor,ngOnInit, orngAfterContentInit. - Notice that the two mutations triggered in the
constructorandngOnInitremain idle and do not indicate the pending state while the mutations are running.
Expected behavior
As a user, I expect the mutation to always indicate the correct idle and pending state, i.e., switch from idle to pending when a mutation has been triggered.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- OS: Windows, maxOS,
- Browser: Chrome, Edge
Tanstack Query adapter
angular-query
TanStack Query version
v5.74.3
TypeScript version
v5.6.3
Additional context
No response
- Linguagem predominante
- TypeScript
- Estrelas
- 50.4k
- Forks
- 4.3k
- Merge médio
- 9h 42min
- PRs com merge (30d)
- 590
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 TanStack/query
-
QueryClient.isFetching and useIsFetching accept a fetchStatus filter and ignore itTalvez já em andamento @Apu-Emdad assumiu há 7 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)Talvez livre de novo @LeonxLJX assumiu há 48 dias e não há nenhum pull request aberto. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
TanStack/query#11358 · 2 comentários · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
useBaseQuery fetches the old query key when an <Activity> tree is revealedTalvez já em andamento @lazerg assumiu há 1 dia. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
Mantenedores costumam responder em até 1 dia
-
[query-broadcast-client-experimental] broadcastQueryClient: an `added` event overwrites a receiving query that has no data (e.g. in error) with the sender's empty stateTalvez já em andamento @lazerg assumiu há 1 dia. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 25/100
Mantenedores costumam responder em até 1 dia
-
solid-query 6.0.0-rc.5: onCacheEvent throws NotReadyError during a Solid 2 (rc.14+) transition landingTalvez já em andamento @UzumakiODZ assumiu há 7 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 28/100
TanStack/query#12031 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de TanStack/query
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
phivk/rubiks-lab#33 ·
Mantenedores costumam responder em até 1 dia
-
BUG:Edit Album strips spaces from the password so albums with a leading/trailing space in the password can't be editedTalvez já em andamento @ManyaJain111 assumiu hoje. Abertabug enhancement possible-duplicate
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
AOSSIE-Org/PictoPy#1637 · 4 comentários ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
chaitin/MonkeyCode#1437 ·
Mantenedores costumam responder em até 1 dia
-
rtdb-info-connected-order test: unhandled 'connection is closed' rejection fails the CLI suiteAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
area:cards enhancement migration ready-for-agent
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
fil-donadoni/tolaria#6309 ·
Mantenedores costumam responder em até 1 dia