[angular-query] toResource causes console error with debounced validation
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 40/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- angular, typescript
Línea de trabajo
Examine the Angular Query integration, specifically the toResource() helper and its interaction with Signal Forms' validateAsync debounce. Start by reviewing the provided StackBlitz example to see the error in action. Look at the relevant source files for toResource and the Signal Forms integration. Understand how debounced validation triggers a LOADING state and why it causes a console error. Check the existing tests for toResource and validation to see if they cover this scenario.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
First, thank you for publishing the stable Angular Query RC and for adding the new toResource() integration in #11516.
I found an issue when using toResource(injectQuery(...)) with Signal Forms validateAsync() and its debounce option. While the debounce is pending, Angular reports the following global console error:
ERROR ResourceParamsStatus: LOADING
The query itself succeeds and validation completes. The error occurs while the debounced validator parameter is loading.
Removing the debounce option from validateAsync makes the console error disappear.
This seems related to the Signal Forms integration discussed in https://github.com/TanStack/query/discussions/10788. The current design of this helper might need to be reconsidered so that it can better support this use case as well.
Your minimal, reproducible example
https://stackblitz.com/edit/stackblitz-starters-rq6qsn9u?file=src%2Fmain.ts
Steps to reproduce
- Run the example.
- Type any value into the input.
- Observe the browser console while the 200 ms debounce is pending.
Expected behavior
The validator should enter its pending state and then resolve without reporting a global error.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- @angular/core : 22.1.7
- Browser: Chromium
- Operating system: macOS
Tanstack Query adapter
angular-query
TanStack Query version
v5.0.0-rc.0
TypeScript version
6.0.2
Additional context
The traditional approach to define a resource using
resource({
params,
loader: ({ params }) => queryClient.query(options(params)),
})
works due to loader only executing once the params are available.
- Lenguaje dominante
- TypeScript
- Estrellas
- 50.3k
- Forks
- 4.2k
- Merge medio
- 22 h 33 min
- PR fusionados (30 d)
- 214
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/query
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 78/100
Todos los issues de TanStack/query
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
bcgov/bc-wallet-mobile#4761 · 1 comentario ·
-
external-issue to-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
area-deployment area-integrations triage:bot-seen
Dificultad 2/5 Medio día Aptitud para principiantes 86/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
refactor
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100