Skip to content

test(solid-query/useQueries): add test for not fetching during the restoring period when 'isRestoring' is true#10951

Merged
sukvvon merged 1 commit into
mainfrom
test/solid-query-useQueries-isRestoring
Jun 14, 2026
Merged

test(solid-query/useQueries): add test for not fetching during the restoring period when 'isRestoring' is true#10951
sukvvon merged 1 commit into
mainfrom
test/solid-query-useQueries-isRestoring

Conversation

@sukvvon

@sukvvon sukvvon commented Jun 14, 2026

Copy link
Copy Markdown
Member

🎯 Changes

react-query's useQueries tests cover that queries do not fetch while isRestoring is true, but solid-query had no equivalent. This ports that coverage.

  • Add a test that wraps useQueries in an IsRestoringProvider set to true and asserts that both queries stay pending / idle with no data and that their queryFns are never called, even after advancing past their sleep duration.

The test passes against the current behavior — no source changes.

✅ 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
    • Expanded test coverage for query restoration scenarios, ensuring queries properly maintain pending status with idle fetch status when restoring application state, preventing unnecessary query function invocation during restoration, and validating that state remains stable and unchanged throughout the restoration process and subsequent operations.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e3c0117a-acdb-4ed4-8d14-d8ccbf314b6c

📥 Commits

Reviewing files that changed from the base of the PR and between 0e2bfe7 and 9f6bb17.

📒 Files selected for processing (1)
  • packages/solid-query/src/__tests__/useQueries.test.tsx

📝 Walkthrough

Walkthrough

Adds IsRestoringProvider to the solid-query useQueries test file imports and introduces one new test that wraps two useQueries calls inside IsRestoringProvider (returning true), asserting both queries remain in pending/idle state and their query functions are never invoked.

useQueries isRestoring test

Layer / File(s) Summary
IsRestoringProvider import and restoring test case
packages/solid-query/src/__tests__/useQueries.test.tsx
IsRestoringProvider is added to the .. import block; a new test renders useQueries under IsRestoringProvider with true, asserts status: pending and fetchStatus: idle for both queries initially and after timer advancement, and verifies query functions have zero call counts.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐇 A restoring flag holds the queries at bay,
No fetches shall run on this fine idle day.
Pending and quiet, the statuses rest,
Zero calls made — the bunny says "best!"
Timer advanced, still nothing has stirred,
The restore gate works — every check has been heard. 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a test for useQueries that verifies queries do not fetch when isRestoring is true.
Description check ✅ Passed The description follows the template structure with Changes section, completed Checklist, and Release Impact. All required sections are present and properly filled out.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/solid-query-useQueries-isRestoring

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

@sukvvon sukvvon self-assigned this Jun 14, 2026
@nx-cloud

nx-cloud Bot commented Jun 14, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 9f6bb17

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

☁️ Nx Cloud last updated this comment at 2026-06-14 19:36:07 UTC

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new

pkg-pr-new Bot commented Jun 14, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@10951

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 9f6bb17

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 12.11 KB (0%)
react minimal 9.08 KB (0%)

@sukvvon sukvvon merged commit 588b30f into main Jun 14, 2026
9 checks passed
@sukvvon sukvvon deleted the test/solid-query-useQueries-isRestoring branch June 14, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant