Skip to content

test(angular-query-persist-client): use the '.then()' convention consistently#11088

Merged
sukvvon merged 1 commit into
mainfrom
test/angular-query-persist-client-then-convention
Jul 20, 2026
Merged

test(angular-query-persist-client): use the '.then()' convention consistently#11088
sukvvon merged 1 commit into
mainfrom
test/angular-query-persist-client-then-convention

Conversation

@sukvvon

@sukvvon sukvvon commented Jul 20, 2026

Copy link
Copy Markdown
Member

🎯 Changes

The queryFn in "should not refetch after restoring when data is fresh" was left as async/await even though the rest of the file uses the .then() convention. The side effect (fetched = true) happens strictly after await sleep(...), so it can be expressed as sleep(...).then(() => { ... }) without changing execution order.

✅ 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
    • Updated a persistence test to preserve its timing behavior while verifying that fresh restored data does not trigger an unnecessary refetch.

@nx-cloud

nx-cloud Bot commented Jul 20, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 794b2c8

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 3m View ↗

☁️ Nx Cloud last updated this comment at 2026-07-20 01:20:04 UTC

@sukvvon sukvvon self-assigned this Jul 20, 2026
@coderabbitai

coderabbitai Bot commented Jul 20, 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: cd6f8c30-fce9-4082-a256-18f49e1c495f

📥 Commits

Reviewing files that changed from the base of the PR and between 44f38df and 794b2c8.

📒 Files selected for processing (1)
  • packages/angular-query-persist-client/src/__tests__/with-persist-query-client.test.ts

📝 Walkthrough

Walkthrough

The persisted query test rewrites its delayed queryFn from async/await to a promise-returning sleep(10).then(...) implementation while preserving fetch timing and the resolved value.

Changes

Persisted query test

Layer / File(s) Summary
Delayed query function
packages/angular-query-persist-client/src/__tests__/with-persist-query-client.test.ts
The injectQuery function now returns a delayed promise chain, setting fetched after the delay and resolving to 'fetched'.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

  • TanStack/query#10903: Both changes adjust timing-dependent query function tests to use delayed promise resolution.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the test-only change and states the main update succinctly.
Description check ✅ Passed The description follows the template and includes the changes, checklist, and release impact sections with adequate detail.
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.
✨ 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/angular-query-persist-client-then-convention

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 20, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 794b2c8

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

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

@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.

@sukvvon
sukvvon merged commit 0a612ec into main Jul 20, 2026
9 of 11 checks passed
@sukvvon
sukvvon deleted the test/angular-query-persist-client-then-convention branch July 20, 2026 10:39
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