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.

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.

1 participant