[angular-query] toResource causes console error with debounced validation
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 40/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- angular, typescript
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 50.3k
- Fork
- 4.2k
- Merge trung bình
- 22 giờ 33 phút
- Pull request đã merge (30 ngày)
- 214
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TanStack/query
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
Tất cả issue của TanStack/query
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mksglu/context-mode#1200 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
anthropics/claude-code#96687 ·
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
AOSSIE-Org/DebateAI#582 · 2 bình luận ·