Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Angular: injectMutation skips pending state when triggered in constructor or ngOnInit

Abierto
#9,020 1 comentario 0 reacciones 2 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@benjavicente ya está trabajando en esto.

Desde el 2/10/2026.

  • #9098 de @ThiloAschebrock — cerrado sin fusionar

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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
  1. Refresh the page.
  2. Observe the state changes for the three mutations triggered in an Angular constructor, ngOnInit, or ngAfterContentInit.
  3. Notice that the two mutations triggered in the constructor and ngOnInit remain 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

Lenguaje dominante
TypeScript
Estrellas
50.4k
Forks
4.2k
Merge medio
11 h 33 min
PR fusionados (30 d)
421

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TanStack/query

Todos los issues de TanStack/query

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.