Repository navigation
Conversation
…ht payload keeps in a text row #1477 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
fix/flight-text-rows-1477
branch
from
November 1, 2026 01:22
b50e1e5 to
34b50ee
Compare
…t; soften the #1477 notes Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
fix/flight-text-rows-1477
branch
from
November 1, 2026 03:02
34b50ee to
6a10265
Compare
This was referenced Nov 1, 2026
Closed
Merged
Contributor
Author
|
Landed in v0.0.154 as nik |
5 of 6 tasks
1 task
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.
Refs #1477 (fixes the shape found; the corpus criterion is a run over the stored crawls and is not done here).
Cause found, and the corpus re-detect below confirms it recovers most of the losers. React Flight writes a string of 1 KB or more as its own text row,
id:T<hex byte length>,<text>, and the element points at it:["$","$L2",null,{"id":"analytics","children":"$7"}]. #1437's reader parsed only the line rows and an element's own strings, so a Clarity loader inside a larger inline snippet (a loader beside other trackers in onenext/script, or any snippet over 1 KB) hadchildrenor__htmlset to the reference"$7"and its text sat in a row the reader skipped. The standard 400-character Clarity snippet alone is a plain string and was already read (the real-build fixtures pass), which fits only some of the 46 sites; The remaining misses are listed in the corpus line below; the issue stays open for them.flight.ts: the joined text is parsed into rows properly:id:T<hex>,text rows consume exactly that many UTF-8 bytes (newlines and multi-byte characters included) and are kept by id; other rows end at a newline as before.src, string or arraychildrenanddangerouslySetInnerHTML.__htmlthat are a"$<id>"reference to a text row are resolved before the script-component test and the read. An arraychildrennow counts for theidplus code-token rule.ppointing at a long text row, an id'd component with prose text, atype="application/ld+json"script, anahref).flight-script-narrow-1437.test.ts, 44 pass; 4 of the new ones fail on main): children pointing at a text row for an id'dnext/script, a strategy, a plainscriptand array children;__htmlpointing at a text row; a text row first with newlines and multi-byte characters followed by other rows; a text row split over chunks; the prose and data negatives; hostile text rows (declared length past the data, 50,000 heads) stay under 3 s. The other flight and markup suites pass."$7"children, pointing at a 1 MB row threw out-of-memory at about 2 MB of HTML before). Tests: 4,000+4,000 elements at one 1 MB row with a Clarity loader inside it and another row with a GTM script still found; 100,000 references from one element; 40 distinct 1 MB rows stay under the cap; declared lengths too large and too small with emoji and CJK never throw and an exact one reads the rows after it (47 tests; the two bound tests fail without the dedupe and cap).Mapcreated insideflightLoaderText, not at module level), so thousands of references to one long text row cost one scan, not one each. Tests: 20,000 references to a 70 KB row that looks like code but has no code token finish under 1 s (fail without the memo); 4,000 + 4,000 elements and one element with 100,000 references to a 1 MB row; 40 distinct 1 MB rows under the cap. Measured on a scratch copy: 50,000 references 253 ms (main 238 ms).window.claritycalls, and 2 that only mention Clarity in prose, correctly dropped.Skill: no change needed.
nik