| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
bugbot run |
Sorry, something went wrong.
|
bugbot run |
Sorry, something went wrong.
There was a problem hiding this comment.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
|
bugbot run |
Sorry, something went wrong.
|
bugbot run |
Sorry, something went wrong.
There was a problem hiding this comment.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
|
bugbot run |
Sorry, something went wrong.
There was a problem hiding this comment.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
size-limit report 📦⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.
|
Sorry, something went wrong.
Under cacheComponents the SDK stopped enabling clientTraceMetadata, because a shell that Next.js prerenders inside one request is cached and served to later visitors, and a sentry-trace tag baked into it would replay that request's trace to all of them. ISR pages had the same problem, patched on the client by removing the tags on generateStaticParams routes. Next.js computes a document's trace tags inside the "prerender route (app)" span when it prerenders and outside of it when it renders for a request, including the resume of a shell. Register a SentryPropagator subclass that hands out no trace context while that span is active, so a prerendered shell never contains a trace and any tag that reaches the browser belongs to the current request. Only swap the propagator when the Node SDK registered its own, so a foreign OpenTelemetry setup stays untouched. Enable clientTraceMetadata again under cacheComponents and remove the client-side ISR heuristic together with the isrRoutes manifest field. The guard covers ISR shells as well, including revalidate routes without generateStaticParams. Refs #24944 Refs JS-3863 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The turbopack dev variant runs with TEST_ENV=dev-turbopack, which the development check did not match, so the tags-absent assertions ran against a dev render where the tags are fresh and kept. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Next.js computes a document's trace meta tags at the top of its prerender function, inside the span it wraps the prerender in. Recognizing that span by its attributes fails when the request is not sampled: the span is then non-recording and has no attributes, so the propagator still wrote a `sampled=0` tag into the cached shell, and every later visitor inherited the negative decision. A span nested in the prerender would have passed the check as well. Mark the prerender on the OpenTelemetry context instead, through the tracer provider the Node SDK registered, and have the propagator skip a marked context. The mark is inherited by everything that runs inside the prerender and exists whether or not the span records. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… caller Next.js starts its spans through `startActiveSpan`, which the tracer wrapper marks on the context. A span started through `startSpan` and set on a context by the caller takes a different path, so the wrapper remembers those spans and the propagator checks the span on the context too. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…flare ISR pages revalidate inside a request of the Worker, where `withSentry` of `@sentry/nextjs/cloudflare` registers its own tracer provider and propagator. The guard only covered the setup of the Node SDK, so a shell prerendered in the Worker got that request's trace. The Next.js integration now marks prerenders on the tracer provider `@sentry/cloudflare` registered and its propagator skips a marked context. Also moves the changelog entry above the contributor line and fixes a test comment that pointed to a file of the follow-up PR. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The ISR shells of the e2e apps come from the build, where the SDK does not run, so the tag assertions passed with or without the guard. A page with a one second window makes the server prerender it again inside a request. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
bugbot run |
Sorry, something went wrong.
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 576a529. Configure here.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Under cacheComponents the SDK did not enable experimental.clientTraceMetadata (#21141). A shell that Next.js prerenders during one request is cached and served to later visitors, and a sentry-trace tag inside it would attach all of them to that one request. ISR pages had the same problem, worked around on the client by removing the tags on routes with generateStaticParams (#18192).
Next.js computes the trace tags of a document inside the prerender route (app) span when it prerenders, and outside of it when it renders for a request, including when it resumes a shell. The server SDK now marks that span on the OpenTelemetry context, and its propagator hands out nothing on a marked context. A prerendered shell never contains a trace, so any tag that reaches the browser belongs to the current request. The mark sits on the context rather than the span because an unsampled request makes the span non-recording, with no attributes to recognize it by, and a sampled=0 tag in the shell would drop every later pageload. Checked in Next.js 15.0 through 16.4.
With that, clientTraceMetadata is enabled again under cacheComponents, and the client-side ISR workaround and the isrRoutes manifest field are removed. The guard covers ISR shells too, including revalidate routes the file scan never found.
The guard is applied to the tracer provider and propagator the Node SDK registers, and withSentry of @sentry/nextjs/cloudflare applies it to its own setup, since ISR pages revalidate inside a request of the Worker. A custom OpenTelemetry setup such as @vercel/otel is left as is and does not get the guard.
An ISR page with revalidate = 1 makes the e2e suite exercise the guard at runtime; the other ISR shells come from the build, where the SDK does not run.
On its own this PR keeps the current client behaviour: tags in <head> are continued and are now always fresh. The tag of a resumed shell arrives with the resumed part, which the client only reads in #25142.
Refs #24944, see #24298