Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughExtends retryOnMount to accept a callback Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit 53c954d
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview1 package(s) bumped directly, 23 bumped as dependents. 🟨 Minor bumps
🟩 Patch bumps
|
More templates
@tanstack/angular-query-experimental
@tanstack/eslint-plugin-query
@tanstack/preact-query
@tanstack/preact-query-devtools
@tanstack/preact-query-persist-client
@tanstack/query-async-storage-persister
@tanstack/query-broadcast-client-experimental
@tanstack/query-core
@tanstack/query-devtools
@tanstack/query-persist-client-core
@tanstack/query-sync-storage-persister
@tanstack/react-query
@tanstack/react-query-devtools
@tanstack/react-query-next-experimental
@tanstack/react-query-persist-client
@tanstack/solid-query
@tanstack/solid-query-devtools
@tanstack/solid-query-persist-client
@tanstack/svelte-query
@tanstack/svelte-query-devtools
@tanstack/svelte-query-persist-client
@tanstack/vue-query
@tanstack/vue-query-devtools
commit: |
size-limit report 📦
|
# Conflicts: # packages/vue-query/src/queryOptions.ts
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/query-core/src/types.ts (1)
113-121:⚠️ Potential issue | 🟠 MajorAvoid a type-level breaking change by keeping
Enabledas a deprecated alias.Renaming the exported alias to
QueryBooleanOptioncan break consumers importingEnabledfrom query-core. Please keep a compatibility alias.🔧 Backward-compatible type alias
export type QueryBooleanOption< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, > = | boolean | ((query: Query<TQueryFnData, TError, TData, TQueryKey>) => boolean) + +/** `@deprecated` Use `QueryBooleanOption` instead. */ +export type Enabled< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> = QueryBooleanOption<TQueryFnData, TError, TData, TQueryKey>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/query-core/src/types.ts` around lines 113 - 121, Keep a backward-compatible deprecated alias by exporting Enabled as an alias of QueryBooleanOption so existing consumers don't break; locate the type QueryBooleanOption and add an exported type alias named Enabled that points to QueryBooleanOption and mark it deprecated in a comment or JSDoc so downstream code can still import Enabled while signalling it will be removed later.
🧹 Nitpick comments (1)
packages/react-query/src/__tests__/useQuery.test.tsx (1)
6910-6912: Tighten callback assertion to avoid false positives.This test currently allows extra callback invocations. Since it verifies invocation semantics, asserting exact count makes it stricter.
♻️ Suggested test hardening
- expect(retryOnMount).toHaveBeenCalled() + expect(retryOnMount).toHaveBeenCalledTimes(1) const query = retryOnMount.mock.calls.at(-1)![0]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/react-query/src/__tests__/useQuery.test.tsx` around lines 6910 - 6912, The test currently allows extra invocations of the mock retryOnMount which can mask incorrect behavior; tighten the assertion by explicitly checking the exact number of calls (e.g., expect(retryOnMount).toHaveBeenCalledTimes(1)) before inspecting the last call, then continue to grab the single call (retryOnMount.mock.calls[0] or .at(0)) and assert query.state.status === 'error'; update the useQuery.test.tsx assertion around the retryOnMount mock to enforce exact call count and use the specific call index when creating the query variable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/query-core/src/types.ts`:
- Around line 113-121: Keep a backward-compatible deprecated alias by exporting
Enabled as an alias of QueryBooleanOption so existing consumers don't break;
locate the type QueryBooleanOption and add an exported type alias named Enabled
that points to QueryBooleanOption and mark it deprecated in a comment or JSDoc
so downstream code can still import Enabled while signalling it will be removed
later.
---
Nitpick comments:
In `@packages/react-query/src/__tests__/useQuery.test.tsx`:
- Around line 6910-6912: The test currently allows extra invocations of the mock
retryOnMount which can mask incorrect behavior; tighten the assertion by
explicitly checking the exact number of calls (e.g.,
expect(retryOnMount).toHaveBeenCalledTimes(1)) before inspecting the last call,
then continue to grab the single call (retryOnMount.mock.calls[0] or .at(0)) and
assert query.state.status === 'error'; update the useQuery.test.tsx assertion
around the retryOnMount mock to enforce exact call count and use the specific
call index when creating the query variable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2a7bf7f7-810e-4787-93e1-3f308f5094c4
📒 Files selected for processing (14)
.changeset/silver-places-pick.mddocs/framework/react/reference/useQuery.mddocs/framework/solid/reference/useQuery.mdpackages/preact-query/src/__tests__/QueryResetErrorBoundary.test.tsxpackages/preact-query/src/__tests__/useQuery.test.tsxpackages/query-core/src/query.tspackages/query-core/src/queryObserver.tspackages/query-core/src/types.tspackages/query-core/src/utils.tspackages/react-query/src/__tests__/QueryResetErrorBoundary.test.tsxpackages/react-query/src/__tests__/useQuery.test.tsxpackages/solid-query/src/__tests__/useQuery.test.tsxpackages/vue-query/src/queryOptions.tspackages/vue-query/src/useQuery.ts
* feat(core): callback for retryOnMount * ci: apply automated fixes * fix: vue --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
retryOnMountnow accepts a callback that receives the query and returns a boolean to determine retry-on-mount behavior.Documentation
Bug Fixes
retryOnMount: falsenow prevents retries only when a query is errored and has no data.Tests
retryOnMount.