docs: update details about unstable_retry() behavior#91827
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2018f412d2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Compared to a custom React error boundary, `unstable_catchError` is designed to work with Next.js out of the box: | ||
|
|
||
| - **Built-in error recovery** — [`unstable_retry()`](/docs/app/api-reference/file-conventions/error#unstable_retry) re-fetches and re-renders the error boundary's children, including Server Components. | ||
| - **Built-in error recovery** — [`unstable_retry()`](/docs/app/api-reference/file-conventions/error#unstable_retry) retries rendering the page with fresh data in Server Components from the root. |
There was a problem hiding this comment.
Avoid promising fresh data from unstable_retry
This wording overstates what unstable_retry() does: in the App Router implementation it calls router.refresh(), which issues a new request but does not invalidate server-side cache, so cached fetch results can be reused. In apps that rely on cache invalidation (revalidatePath/revalidateTag), readers may expect retry to always return fresh data and misdiagnose recovery behavior when the same cached data is rendered again.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
unstable_retry() behavior
Summary
catchErrordocs to say "retries rendering the error boundary's children with fresh data in Server Components" instead of "re-fetches and re-renders the error boundary's children, including Server Components"