You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fa2f4e1
Browse filesBrowse the repository at this point in the historyBrowse files
feat(nextjs): Wait for the resumed part of a document before starting the pageload
A document that resumes a prerendered shell gets its sentry-trace tag with
the resumed chunk, which lands in <body> after the SDK has usually already
run. A pageload created at that point can only link the server trace.
Continue whatever tag is in the document, last one wins, and when there is
no tag, no Server-Timing trace and the document is still streaming, wait
for the tag before creating the pageload span, bounded by DOMContentLoaded
and a 10 second cap. The span's start is backdated to the time origin and
its children come from the performance timeline, so it looks the same as
before, only inside the server's trace.
A client-side navigation during the wait starts the pageload with a fresh
trace first, so the navigation is filed as its redirect instead of being
the only record of the visit.
Fixes#24944
Refs JS-3863
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
6
6
7
-
- **feat(nextjs)**: Browser pageloads of apps with `cacheComponents` enabled now connect to the server request again. The SDK stopped emitting `sentry-trace` meta tags for these apps because a cached shell could replay the trace of the request that rendered it to every later visitor. The server SDK now refuses to hand out trace context while Next.js prerenders a document, so cached shells never carry a trace, and a tag that is in the document was always rendered for the current request. This also covers ISR pages, which no longer need the client-side meta tag removal based on `generateStaticParams`; the `isrRoutes` field of the injected route manifest is gone.
7
+
- **feat(nextjs)**: Browser pageloads of apps with `cacheComponents` enabled now connect to the server request again. The SDK stopped emitting `sentry-trace` meta tags for these apps because a cached shell could replay the trace of the request that rendered it to every later visitor. The server SDK now refuses to hand out trace context while Next.js prerenders a document, so cached shells never carry a trace, and a tag that is in the document was always rendered for the current request. This also covers ISR pages, which no longer need the client-side meta tag removal based on `generateStaticParams`; the `isrRoutes` field of the injected route manifest is gone. Because the resumed part of a Cache Components document usually arrives after the SDK started, the pageload span is created once that part has streamed in, or once the document finished parsing, with its start still at the time origin. Fetches that fire before that point are not attached to the pageload.
8
8
9
9
- **fix(cloudflare)**: Durable Object constructors now run in their own isolation scope. When work that the constructor starts, for example a `blockConcurrencyWhile` callback, calls a method of the instance, that call is no longer treated as an incoming RPC call, so an error the instance catches itself is no longer reported as unhandled. As a result, `Sentry.setTag()`, `setUser()` and `setContext()` in a constructor now apply only to that constructor work. They no longer reach later `fetch`, RPC or `alarm` invocations, because the scope they used to write to is shared by every Durable Object and handler in the isolate. Use `initialScope` for static data, and set per-instance data in each handler.
0 commit comments