Skip to content

[16.3.x] Return client errors for unrecognized Server Actions - #98491

Open
icyJoseph wants to merge 1 commit into
next-16-3from
backport-98123-to-next-16-3
Open

[16.3.x] Return client errors for unrecognized Server Actions#98491
icyJoseph wants to merge 1 commit into
next-16-3from
backport-98123-to-next-16-3

Conversation

@icyJoseph

Copy link
Copy Markdown
Member

Backports #98123 ("Return client errors for unrecognized Server Actions") to next-16-3.

## Summary

- return `400 Bad Request` when a Server Action reference ID does not
match the expected format
- return `409 Conflict` when a well-formed action ID is unavailable in
the current deployment, including deployment skew
- apply the same classification to IDs from the `Next-Action` header and
multipart MPA forms, including direct and bound actions in Node and Edge
runtimes
- return generic text bodies matching the client error category, without
exposing action-ID details
- derive marked forwarded-action responses from the original action ID
so an unexpected or mixed-version worker response cannot change the
client error semantics

Fetch actions previously had dedicated 404 handling, while equivalent
MPA form submissions fell through to the generic error path and returned
500. This removes that transport-dependent behavior and distinguishes
malformed or scanning traffic from legitimate stale clients without
treating either case as a missing page or an internal server failure.

## Verification

- `pnpm test-dev-turbo
test/e2e/app-dir/actions-unrecognized/actions-unrecognized.test.ts`
- `pnpm test-dev-turbo test/e2e/app-dir/actions/app-action.test.ts -t
'forward.*action'`
- `pnpm test-start-turbo
test/e2e/app-dir/actions-unrecognized/actions-unrecognized.test.ts`
- `pnpm test-dev-webpack
test/e2e/app-dir/actions-unrecognized/actions-unrecognized.test.ts`
- `pnpm test-dev-turbo
test/e2e/app-dir/no-server-actions/no-server-actions.test.ts`

<!-- NEXT_JS_LLM -->

(cherry picked from commit 65c832c)
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: 7d5b668

@icyJoseph
icyJoseph marked this pull request as ready for review September 10, 2026 08:44
@eps1lon eps1lon changed the title [backport] Return client errors for unrecognized Server Actions [16.3.x] Return client errors for unrecognized Server Actions Sep 10, 2026
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.

2 participants