Skip to content

fix(components): truncate string title to prevent crash on large strings COMPASS-10857#8249

Merged
Anemy merged 4 commits into
mainfrom
COMPASS-10857-fix-large-strings-crashing-compass
Jul 17, 2026
Merged

fix(components): truncate string title to prevent crash on large strings COMPASS-10857#8249
Anemy merged 4 commits into
mainfrom
COMPASS-10857-fix-large-strings-crashing-compass

Conversation

@Anemy

@Anemy Anemy commented Jul 16, 2026

Copy link
Copy Markdown
Member

COMPASS-10857

Compass Data Sets -> BloatedDocuments.Bloated documents is a dataset that will reproduce this bug.

I am not sure if this is a recent change in chromium that started this crashing, I'll look about a bit but I don't think that's any blocker. We have had the title in there for > 3 years.
We do render title unbounded from user content in a few other places, but on a relatively quick look it doesn't look like it's anything similar to the size of what a field can be.

before after
Screenshot 2026-07-16 at 14 04 21 Screenshot 2026-07-16 at 14 04 16

@Anemy
Anemy requested a review from a team as a code owner July 16, 2026 21:06
Copilot AI review requested due to automatic review settings July 16, 2026 21:06
@Anemy
Anemy requested a review from mabaasit July 16, 2026 21:06
@github-actions github-actions Bot added the fix label Jul 16, 2026

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.

Pull request overview

This PR addresses a Chromium renderer crash caused by rendering extremely large string values into an HTML title attribute in the BSON value UI component.

Changes:

  • Caps the title attribute for string BSON values to a bounded length.
  • Adds a regression test to ensure very large strings do not propagate unbounded into title.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/compass-components/src/components/bson-value.tsx Truncates string title attribute value to avoid crashes from extremely large strings.
packages/compass-components/src/components/bson-value.spec.tsx Adds test coverage asserting title is capped for large string inputs.

Comment thread packages/compass-components/src/components/bson-value.spec.tsx Outdated
Co-authored-by: Copilot Autofix powered by AI <[email protected]>

@gribnoysup gribnoysup left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!

});
});

it('should cap the title attribute for very large strings', function () {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth an e2e tests... If bloated docs collection showed the issue, maybe we can add a spec specifically for it? Being slow is one thing, but crashing we should catch 🤔

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(doesn't need to happen in the same PR)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, worth an e2e test that loads the Bloated Documents for sure. It'll have to be a static deployment though as we don't want to be inserting and clearing a few MB documents each run I think. Merging to get this fix in while I work on it.

@Anemy
Anemy merged commit e146692 into main Jul 17, 2026
122 of 127 checks passed
@Anemy
Anemy deleted the COMPASS-10857-fix-large-strings-crashing-compass branch July 17, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants