rsnext/test/e2e/app-dir/actions
Zack Tanner 136979fedb
forward missing server actions to valid worker if one exists (#64227)
### What
When submitting a server action on a page that doesn't import the action
handler, a "Failed to find server action" error is thrown, even if
there's a valid handler for it elsewhere.

### Why
Workers for a particular server action ID are keyed by their page
entrypoints, and the client router invokes the current page when
triggering a server action, since it assumes it's available on the
current page. If an action is invoked after the router has moved away
from a page that can handle the action, then the action wouldn't run and
an error would be thrown in the server console.

### How
We try to find a valid worker to forward the action to, if one exists.
Otherwise it'll fallback to the usual error handling. This also adds a
header to opt out of rendering the flight tree, as if the action calls a
`revalidate` API, then it'll return a React tree corresponding with the
wrong page.

Fixes #61918
Fixes #63915

Closes NEXT-2489
2024-04-09 07:10:06 -07:00
..
app forward missing server actions to valid worker if one exists (#64227) 2024-04-09 07:10:06 -07:00
components fix: server actions initiated from static pages (#51534) 2023-09-14 21:22:19 +00:00
pages skip HEAD request in server action redirect (#63819) 2024-03-28 12:54:29 -07:00
app-action-export.test.ts Rename process.env.TURBOPACK -> process.env.TURBOPACK_DEV in test skips (#63665) 2024-03-25 14:17:56 +01:00
app-action-form-state.test.ts Add test case for the permalink option of useFormState (#56329) 2023-10-03 13:47:03 +02:00
app-action-progressive-enhancement.test.ts refactor(tests): make chain more "correct" (#51728) 2024-02-14 20:14:24 +01:00
app-action-size-limit-invalid.test.ts Rename process.env.TURBOPACK -> process.env.TURBOPACK_DEV in test skips (#63665) 2024-03-25 14:17:56 +01:00
app-action.test.ts forward missing server actions to valid worker if one exists (#64227) 2024-04-09 07:10:06 -07:00
middleware.js Fix request body hanging when middleware is preset (#57381) 2023-10-25 02:44:10 +00:00
next.config.js Change allowed forwarded hosts to be allowed origins for Server Actions (#58023) 2023-11-08 11:20:32 +01:00