Repository navigation
Conversation
add a comment on line no 172
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
π WalkthroughWalkthroughThe Next.js App Router setup documentation comments out the ChangesNext.js documentation
Estimated code review effort: 1 (Trivial) | ~2 minutes π₯ Pre-merge checks | β 5β Passed checks (5 passed)
β¨ Finishing Touchesπ§ͺ Generate unit tests (beta)
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. Comment |
@trpc/client
@trpc/next
@trpc/openapi
@trpc/react-query
@trpc/server
@trpc/tanstack-react-query
@trpc/upgrade
commit: |
2 of 3 tasks
Nick-Lucas
pushed a commit
that referenced
this pull request
Jul 26, 2026
## π― Changes Fixes a CI-only failure of `transforms.test.ts > hooks optimistic-update.tsx`: `Expected "Posts: 1initial", Received "Posts: 2initialFoo"` **at the initial-render assertion** β reproducible on unrelated PRs (the docs-only #7445, and #7447), always with `retry x2` all failing the same way. Two leaks between spec runs (the spec executes twice per test β input component and transformed snapshot β and again on CI retries), both via module-scoped state: 1. **In-flight mutation re-populates the server after reset.** The fixture's update is optimistic, so a spec run finishes (or fails) with the `create` mutation still in flight. `resetFixtureState()` truncates `posts`, then the late mutation settles and pushes `'Foo'` back β the next run's (or retry's) initial fetch returns `2initialFoo` for its whole `waitFor` window. Under CI load the settle reliably lands in that gap; on a fast local machine (where `retry` is 0 anyway) it practically never does, which is why this only ever failed in CI. The spec's disposer is now async (`makeAsyncResource` + `await using`) and waits for `queryClient.isMutating() === 0` before resetting. 2. **The shared `QueryClient` cache outlives a run.** `renderApp` now clears it before mounting, so a retry can't render the previous attempt's cached data. This covers all nine fixtures using the harness; no spec renders more than once per run, so nothing relied on cache persistence. ## β Checklist - [x] I have followed the steps listed in the [Contributing guide](https://github.com/trpc/trpc/blob/main/CONTRIBUTING.md). - [ ] If necessary, I have added documentation related to the changes made. - [x] I have added or updated the tests related to the changes made. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Improved test isolation by resetting the appβs data cache before each render, preventing prior render or retry state from leaking into later tests. * Enhanced optimistic-update test cleanup by waiting for all in-flight mutations to fully complete before resetting fixture state and unmounting. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Contributor
|
This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #
π― Changes
This is a documentation update.
setup.mdx.β Checklist
Summary by CodeRabbit
superjsonimport from the example configuration.