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
fix(web): copied startup error details no longer end in a broken character - #41937
When the app fails to start, the error screen's report cuts the error at 6,000 UTF-16 units with details.slice(0, MAX_ERROR_CHARS) before [truncated]. When an emoji sits on the cut, half of it stays behind, so Copy error details copies text with a lone surrogate, which pastes as � before [truncated] in the report a user files.
buildErrorReport now steps back one unit when the cut would split a surrogate pair, the same guard as #41901. It stays inline because bootError.ts has no runtime imports and runs when the app's own chunks fail to load.
Tested:
Extended "cuts long errors but keeps the environment" in bootError.test.ts with an error whose 6,000th and 6,001st units are one emoji. It fails before the change (the report keeps the high surrogate) and passes after it. All 8 cases in the file pass.
vp run check:changed: format, lint, knip, typecheck, tests and React compiler pass.
Prepared with Claude Opus 5.5 in T3 Code (Claude Code harness).
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Reviewing files that changed from the base of the PR and between 33d85cd and 3d89d05.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
buildErrorReport now avoids truncating between the two code units of a surrogate pair. A test covers an emoji at the truncation boundary.
Changes: Error report truncation
Layer / File(s)
Summary
Preserve surrogate pairs at the truncation boundary apps/web/src/lib/bootError.ts, apps/web/src/lib/bootError.test.ts
When the truncation boundary follows a high surrogate, buildErrorReport trims one code unit before adding the existing marker. A test checks the retained prefix and marker for an emoji at the boundary.
Copied startup error details will no longer end with a broken character when truncation falls inside an emoji. The change is small and localized, and no merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the change: copied startup error details no longer end in a broken character. It matches the diff, which stops buildErrorReport from splitting a surrogate pair at the 6,000-unit trunca…
Description check
The description follows the template. It states the problem (the cut at 6,000 UTF-16 units can leave a lone surrogate), the change (step back one unit when the cut would split a pair), and the reason …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the change: copied startup error details no longer end in a broken character. It matches the diff, which stops buildErrorReport from splitting a surrogate pair at the 6,000-unit truncation boundary. It follows the conventional commit form and uses plain language.
Full details: Description check
Explanation
The description follows the template. It states the problem (the cut at 6,000 UTF-16 units can leave a lone surrogate), the change (step back one unit when the cut would split a pair), and the reason the guard stays inline. Verification names a focused test that fails before and passes after, plus the repo check run. Scope explains the bug fix but does not link an issue or explain why no issue is needed. It also does not link a related issue, although it cites #41901 as the same guard. Before/after evidence is not needed because the change is not UI-visible in a screenshot sense.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 0969306 and 33d85cd.
Files selected for processing: 2
apps/web/src/lib/bootError.test.ts
apps/web/src/lib/bootError.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Reproduced in the real web app using Chromium 156 on Linux, 1280×800, light theme and fresh isolated state on each commit. Replaced the main module with one throwing 5,999 x characters, then 😀, then more text; expanded More options, clicked Copy error details, and read the actual clipboard.
Version, Channel, Surface, Platform, User agent and Time remain present on both sides. scenarios:prove exited 0: fails on base and passes on head. All captures were inspected.
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
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
3 participants
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.
When the app fails to start, the error screen's report cuts the error at 6,000 UTF-16 units with
details.slice(0, MAX_ERROR_CHARS)before[truncated]. When an emoji sits on the cut, half of it stays behind, so Copy error details copies text with a lone surrogate, which pastes as�before[truncated]in the report a user files.buildErrorReportnow steps back one unit when the cut would split a surrogate pair, the same guard as #41901. It stays inline becausebootError.tshas no runtime imports and runs when the app's own chunks fail to load.Tested:
bootError.test.tswith an error whose 6,000th and 6,001st units are one emoji. It fails before the change (the report keeps the high surrogate) and passes after it. All 8 cases in the file pass.vp run check:changed: format, lint, knip, typecheck, tests and React compiler pass.Prepared with Claude Opus 5.5 in T3 Code (Claude Code harness).
🤖 Generated with Claude Code