-
Couldn't load subscription status.
- Fork 29.7k
fix(nodejs-middleware): await for body cloning to be properly finalized #85418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: canary
Are you sure you want to change the base?
fix(nodejs-middleware): await for body cloning to be properly finalized #85418
Conversation
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
235ef84 to
545f208
Compare
Failing test suitesCommit: 545f208 | About building and testing Next.js
Expand output● app-dir - server source maps edge runtime › logged errors have a sourcemapped stack with a codeframe
Expand output● no-double-tailwind-execution › should run tailwind only once initially and per change
Expand output● fallback-shells › without IO › should start and not postpone the response
Expand output● use-cache-custom-handler › should use a modern custom cache handler if provided
Expand output● dynamic on hover › prefetches the dynamic data for a Link on hover
Expand output● app dir - prefetching › should show layout eagerly when prefetched with loading one level down ● app dir - prefetching › should immediately render the loading state for a dynamic segment when fetched from higher up in the tree
Expand output● layout sharing in non-static prefetches › full prefetches should omit layouts that were already prefetched with a full prefetch ● layout sharing in non-static prefetches › navigations should omit layouts that were already prefetched with a full prefetch ● layout sharing in non-static prefetches › segment-level prefetch config › does not unnecessarily use a runtime prefetch for sub-pages of runtime-prefetchable layouts ● layout sharing in non-static prefetches › segment-level prefetch config › statically prefetches a fully-static page segment if all its runtime-prefetchable parents are available ● layout sharing in non-static prefetches › segment-level prefetch config › uses a runtime prefetch for sub-pages of runtime-prefetchable layouts if requested |
Fixes #85416.
This is a follow up to #77662, where the Node.js middleware was fixed to also support reading (and duplicating) the body's request before being passed to the server action.
However, in that PR, an
awaitwas missed while calling the .finalize() method, which returns a Promise. That missingawaitwould sometimes cause a bug, where the server action would be invoked before the body was completely cloned, causing the bug mentioned in the issue above.