Skip to content

docs: correct refetchOnReconnect default in JSDoc#10632

Open
TheSeydiCharyyev wants to merge 1 commit intoTanStack:mainfrom
TheSeydiCharyyev:fix/refetchOnReconnect-jsdoc-default
Open

docs: correct refetchOnReconnect default in JSDoc#10632
TheSeydiCharyyev wants to merge 1 commit intoTanStack:mainfrom
TheSeydiCharyyev:fix/refetchOnReconnect-jsdoc-default

Conversation

@TheSeydiCharyyev
Copy link
Copy Markdown

@TheSeydiCharyyev TheSeydiCharyyev commented May 4, 2026

Changes

The JSDoc for QueryOptions#refetchOnReconnect referenced networkOnline, which does not exist anywhere in the codebase. The actual default is set in queryClient.ts based on networkMode:

defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== 'always'

Updated the comment to accurately describe the real default.

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

  • Documentation
    • Clarified the default behavior documentation for the reconnect refetch option regarding its interaction with network mode settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 22d3aaa6-832d-4ffe-a3a6-ea44188dc4cb

📥 Commits

Reviewing files that changed from the base of the PR and between c8e1bde and 50c6c37.

📒 Files selected for processing (1)
  • packages/query-core/src/types.ts

📝 Walkthrough

Walkthrough

Documentation for QueryObserverOptions.refetchOnReconnect default behavior was updated to clarify it defaults to true unless networkMode is 'always', replacing the previous reference to networkOnline.

Changes

Documentation Clarification

Layer / File(s) Summary
JSDoc Update
packages/query-core/src/types.ts
Default behavior description for refetchOnReconnect refined to explicitly state true unless networkMode is 'always'.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~1 minute

Poem

🐰 A typo in prose, a clarifying note,
What once was obscure now floats in the light,
The truth of defaults, perfectly quoted,
Docs shine brighter when written just right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: correcting JSDoc documentation for refetchOnReconnect default behavior.
Description check ✅ Passed The description includes all required template sections with substantive content and properly completed checklist items.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

Copy link
Copy Markdown

@ErikPervious ErikPervious left a comment

Choose a reason for hiding this comment

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

Reads consistent with the actual behavior — when networkMode: 'always', the query bypasses online/offline state, so refetchOnReconnect effectively doesn't apply. The old wording referencing networkOnline was misleading. Nice catch.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 7, 2026

View your CI Pipeline Execution ↗ for commit 50c6c37

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 4m 36s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-07 01:22:07 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 7, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@10632

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@10632

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 50c6c37

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