Skip to content

Conversation

@Andarist
Copy link
Contributor

@Andarist Andarist commented Nov 18, 2025

🎯 Changes

This is a test-only change to proactively fix what might be raised as an error in the future, see microsoft/TypeScript#55601 (comment)

βœ… Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

πŸš€ Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Tests
    • Improved type safety in testing infrastructure to ensure better validation and code reliability.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Nov 18, 2025

⚠️ No Changeset found

Latest commit: 1ec8328

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud
Copy link

nx-cloud bot commented Nov 18, 2025

πŸ€– Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution β†— for commit 1ec8328

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ❌ Failed 5m 44s View β†—
nx run-many --target=build --exclude=examples/*... βœ… Succeeded 16s View β†—

☁️ Nx Cloud last updated this comment at 2025-11-23 09:35:37 UTC

Copy link
Collaborator

@TkDodo TkDodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❀️

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 23, 2025

Walkthrough

The Thrower function in the HydrationBoundary test is now explicitly typed to return never, removing a ts-expect-error workaround and its null return statement while maintaining identical runtime behavior.

Changes

Cohort / File(s) Summary
Test type signature refinement
packages/react-query/src/__tests__/HydrationBoundary.test.tsx
Explicit never return type added to Thrower function; removed ts-expect-error comment and dead null return path to tighten TypeScript typing

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Isolated test utility function change with no runtime implications
  • Type-only refinement in a single test file

Poem

🐰 A thrower that never returns to stay,
No more workarounds to chase away,
Types now precise, the promise shall fly,
Never returningβ€”just reaching the sky!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
βœ… Passed checks (2 passed)
Check name Status Explanation
Title check βœ… Passed The title clearly and concisely describes the main change: improving the Thrower declaration in tests with better TypeScript typing.
Description check βœ… Passed The description follows the template structure with all required sections completed, including motivation (proactive TypeScript fix), checklist items marked, and release impact properly assessed.
✨ Finishing touches
  • πŸ“ Generate docstrings
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

πŸ“œ Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between ae47807 and 1ec8328.

πŸ“’ Files selected for processing (1)
  • packages/react-query/src/__tests__/HydrationBoundary.test.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
πŸ““ Common learnings
Learnt from: sukvvon
Repo: TanStack/query PR: 9892
File: packages/solid-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx:331-335
Timestamp: 2025-11-22T09:06:05.219Z
Learning: In TanStack/query test files, when a queryFn contains side effects (e.g., setting flags for test verification), prefer async/await syntax for clarity; when there are no side effects, prefer the .then() pattern for conciseness.
Learnt from: justjake
Repo: TanStack/query PR: 9589
File: packages/query-core/src/queryCache.ts:132-146
Timestamp: 2025-08-25T19:16:59.365Z
Learning: The TypeScript pattern `t satisfies never` in a switch statement's default case is valid for exhaustiveness checking when all possible values of a union type are handled in the switch cases. For `typeof` operations, this ensures all 8 possible return values are covered: "string", "number", "bigint", "boolean", "symbol", "undefined", "object", "function".
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Preview
  • GitHub Check: Test
πŸ”‡ Additional comments (1)
packages/react-query/src/__tests__/HydrationBoundary.test.tsx (1)

214-218: LGTM! Clean proactive fix for future TypeScript compatibility.

The explicit : never return type correctly captures that this function always throws and never returns normally. Removing the ts-expect-error workaround improves type safety and aligns with upcoming TypeScript behavior referenced in the PR objectives.

Verification confirms that Thrower is the only function in the test suite that throws a Promise, so this is a uniquely targeted fix with no other similar patterns requiring updates.

Tip

πŸ“ Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests β€” including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. πŸ“ Description β€” Summarize the main change in 50–60 words, explaining what was done.
  2. πŸ““ References β€” List relevant issues, discussions, documentation, or related PRs.
  3. πŸ“¦ Dependencies & Requirements β€” Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. πŸ“Š Contributor Summary β€” Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. βœ”οΈ Additional Notes β€” Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 23, 2025

More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@9884

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@9884

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@9884

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@9884

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@9884

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@9884

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@9884

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@9884

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@9884

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@9884

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@9884

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@9884

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@9884

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@9884

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@9884

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@9884

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@9884

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@9884

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@9884

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@9884

commit: 1ec8328

@TkDodo TkDodo merged commit c9bc600 into TanStack:main Nov 23, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants