Skip to content

fix(web): copied startup error details no longer end in a broken character - #41937

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
omaribrahim6:fix/boot-error-truncation
Nov 24, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
omaribrahim6:fix/boot-error-truncation

Conversation

@omaribrahim6

Copy link
Copy Markdown
Contributor

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).

🤖 Generated with Claude Code

…acter

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 05:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

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.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

Suggested labels: bugfix

Merge Risk: Minimal · previous review 33d85

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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
Recent review info

Run configuration

Commits

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.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 24, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

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.

Before After
cf90d1a466 3d89d05ff7
Before: lone surrogate renders as a broken character After: truncation ends after complete characters
Display ends at unit 6,000 with 0xD83D; clipboard ends with U+FFFD. Display and clipboard end after 5,999 x characters.
Before recording · Clipboard transcript After recording · Clipboard transcript

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.

Scenario source · Runner configuration with clipboard permissions. Evidence uploaded using ghdrop; no repository changes committed.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 24, 2026
@juliusmarminge
juliusmarminge merged commit 8b8ec75 into pingdotgg:main Nov 24, 2026
19 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants