fix(tanstackstart-react): avoid double-injecting trace meta tags across stream chunks - #23480
Draft
nicohrubec wants to merge 1 commit into
Draft
fix(tanstackstart-react): avoid double-injecting trace meta tags across stream chunks#23480nicohrubec wants to merge 1 commit into
nicohrubec wants to merge 1 commit into
Conversation
…ss stream chunks Inject the trace meta tags at the first <head> and pass subsequent stream chunks through untouched, so a <head> appearing inside a quoted attribute value in a later chunk is no longer matched a second time. Fixes #23468 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
size-limit report 📦
|
nicohrubec
marked this pull request as ready for review
August 21, 2026 10:46
nicohrubec
requested review from
chargome and
s1gr1d
and removed request for
a team
August 21, 2026 10:46
nicohrubec
marked this pull request as draft
August 21, 2026 10:55
Member
Author
|
still trying if I can get a reproduction for this, putting in draft for now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wrapFetchWithSentryrewrites the SSR HTML stream chunk-by-chunk to inject trace meta tags into<head>. Each chunk is scanned independently, so a<head>that appears inside a quoted attribute value in a later chunk gets injected into a second time.Example — a document split so the real
<head>and a second heat tag in an attribute land in different chunks:This breaks because the per-chunk scan has no memory that injection already happened in an earlier chunk. This fix injects at the first
<head>and then passes later chunks through untouched.Note: This should fix a bug in the injection logic but not entirely sure this is the root cause of the attached issue (hard to reproduce since this depends on how the chunks get split up).
Fixes #23468