mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
3904d0c291
## Bug When a Server Action skips page rendering, the successful response path attaches pending revalidations to the response’s `waitUntil` promise. Error paths, including `notFound()`, did not. As a result, a forwarded action that called `revalidatePath()` or `revalidateTag()` and then threw could return its error response without executing the pending invalidation. ## Fix Centralize the skipped-render revalidation handling and attach its promise to successful and error responses. Actions that continue into page rendering retain the existing behavior, where revalidations are executed before rendering. ## Test Plan Add a production regression test that invokes an action which calls `revalidatePath()` followed by `notFound()` and verifies: - The fallback route’s page is not rendered. - The cache handler receives the expected path-tag invalidation. - Removing the new `waitUntil` attachment causes the test to fail.