Files
vercel__next.js/test
Zack Tanner 3904d0c291 Flush pending revalidations for forwarded action error responses (#96945)
## 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.
2026-08-07 16:09:22 -07:00
..
2026-08-07 15:27:12 +02:00
…

See Testing for more information on how you can run/write/debug tests for Next.js.