rsnext/test/e2e/app-dir/actions/app
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
..
catching-error ensure server action errors notify rejection handlers (#61588) 2024-02-02 14:36:39 -08:00
client skip HEAD request in server action redirect (#63819) 2024-03-28 12:54:29 -07:00
client-static fix: server actions initiated from static pages (#51534) 2023-09-14 21:22:19 +00:00
delayed-action forward missing server actions to valid worker if one exists (#64227) 2024-04-09 07:10:06 -07:00
dynamic-csr Remove client only dynamic chunks from edge bundle (#56761) 2023-11-16 15:10:28 +00:00
encryption Fix module-level Server Action creation with closure-closed values (#62437) 2024-02-23 12:00:24 +01:00
error-handling Fix ServerAction rejection reason (#63744) 2024-03-26 17:46:50 -07:00
file feat: add body parser limit for server actions (#51104) 2023-06-23 16:24:18 -07:00
form bug: Fields truncated when submitting form using Server Actions (#59877) 2024-03-18 09:08:29 +00:00
handler Update the mutableCookies class to accept extra options (#48877) 2023-04-26 19:13:03 +00:00
header Use push for Server Action redirections (#54458) 2023-08-23 19:47:46 +00:00
interception-routes fix server actions behavior on intercepted routes (#59175) 2023-12-01 14:45:00 -08:00
mutate-cookie Add test for client router state invalidation caused by cookie mutations (#53494) 2023-08-03 11:02:19 +00:00
no-caching-in-actions Change server actions cache default to no-store (#60170) 2024-01-04 14:01:50 +01:00
redirect-target app router: support side effects on server requests (#48939) 2023-05-04 01:01:40 +02:00
redirects fix: Enable SearchParams to be displayed after redirect in Server Action (#62582) 2024-02-28 14:37:39 -08:00
revalidate Invalidate client cache when cookies have changed in Server Actions (#51290) 2023-06-14 17:26:27 +02:00
revalidate-2 Invalidate client cache when cookies have changed in Server Actions (#51290) 2023-06-14 17:26:27 +02:00
revalidate-multiple Wrap incremental cache in an IPC server (#53030) 2023-07-26 23:19:46 +00:00
server fix flakey app-action test (#63021) 2024-03-07 15:15:20 -08:00
shared Fix shared action module in two layers (#51510) 2023-06-19 21:45:51 +02:00
test fix bugs pertaining to server actions + navigation (#55853) 2023-09-23 01:42:39 +00:00
use-transition fix async action queue behavior (#59038) 2023-11-28 22:54:04 +00:00
layout.js actions: fill prefetchCache with revalidation payload (#49576) 2023-05-11 11:38:19 +02:00
not-found.js Continue page rendering after handling server requests (#47089) 2023-03-13 21:07:44 -07:00