next.js
88383fcc - Fix fetch logging after revalidation via server action (#82643)

Commit
340 days ago
Fix fetch logging after revalidation via server action (#82643) When revalidating a tag or path with a server action, we do want to log any fetches that are made during the subsequent rerendering, when [fetch logging](https://nextjs.org/docs/app/api-reference/config/next-config-js/logging#fetching) is enabled. This got accidentally broken in #64746, where we wrote: > [...] this ensures we don't keep tracking fetch metrics after the request has ended as we only report on request end That's incorrect though, because we report fetch metrics when the _response_ is closed, and not the request: https://github.com/vercel/next.js/blob/0bd7423844e218b19537880a7fa4314749fdf57d/packages/next/src/server/dev/next-dev-server.ts#L530-L546 This is crucial for server actions, when the request is likely already closed while we're rerendering and streaming the response to the client. fixes #80444 closes NAR-307
Author
Parents
Loading