Skip to content

Fix live results error page from browser auto-translate (#48277)#48705

Merged
lucasmrod merged 2 commits into
mainfrom
fix-48277-live-results-translate-crash
Jul 6, 2026
Merged

Fix live results error page from browser auto-translate (#48277)#48705
lucasmrod merged 2 commits into
mainfrom
fix-48277-live-results-translate-crash

Conversation

@lucasmrod

@lucasmrod lucasmrod commented Jul 3, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves #48277

What & why

Running a live report/query (or live policy) on some machines throws a full error page once results start streaming in:

NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

Root cause: Chrome's built-in auto-translate (Google Translate) wraps text nodes in <font> elements, detaching the original DOM nodes React holds references to. As live results stream in over the websocket, table cells (and the responded-count heading) unmount rapidly; React then calls parentNode.removeChild(node) on a node Translate has already moved, throwing NotFoundError. The app's error boundary catches it and renders the error page (react/react#11538).

This is why it's machine-dependent: it only reproduces when Chrome is translating the page. It surfaces on live results specifically because that's one of the few surfaces that unmounts DOM rapidly while displaying translatable text.

Fix: Exclude the live-results subtrees from translation via the notranslate class on the top-level containers of QueryResults (live report/query) and PolicyResults (live policy). These wrappers cover the LiveResultsHeading counts, the results table, and (policy) the errors table. Translation stays enabled everywhere else in the app.

How to reproduce / QA

  1. In Chrome, enable translation of the live results page (right-click → Translate to English, or set a non-English preferred language so the Translate banner activates and choose "Always translate").
  2. Run a live query/report or live policy targeting several hosts so results stream in.
  3. Before the fix: error page appears after a few results. After the fix: results render normally.

Checklist for submitter

  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters.

Testing

  • QA'd all new/changed functionality manually

For unreleased bug fixes in a release candidate, one of:

  • Confirmed that the fix is not expected to adversely impact load test results

Summary by CodeRabbit

  • Bug Fixes
    • Prevented browser auto-translation from modifying live results areas in the policy and query editors.
    • Reduces the chance of display errors during live streaming/remounting of results.
    • Addressed a related Google Translate browser extension issue that could lead to incorrect live-run behavior.
  • Chores
    • Added a changelog entry for the live results translation fix.

Chrome's auto-translate wraps text nodes in <font> elements, detaching
DOM nodes React holds references to. As live query/policy results stream
in and cells unmount, React's removeChild throws NotFoundError, which the
error boundary catches and renders as a full error page.

Exclude the live-results subtrees from translation with the notranslate
class on the QueryResults and PolicyResults containers.
Copilot AI review requested due to automatic review settings July 3, 2026 19:50
@lucasmrod lucasmrod requested a review from a team as a code owner July 3, 2026 19:50

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

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

Prevents Chrome’s auto-translate from crashing Fleet’s live results views (live query/report and live policy) by excluding the rapidly-updating results subtree from translation, avoiding React DOM unmount errors that trigger the error boundary.

Changes:

  • Add the notranslate class to the top-level container in QueryResults to prevent browser translation from mutating streaming DOM nodes.
  • Add the notranslate class to the top-level container in PolicyResults for the same live-streaming results behavior.
  • Document the underlying Chrome/Translate + React removeChild NotFoundError root cause inline for future maintainers.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
frontend/pages/queries/edit/components/QueryResults/QueryResults.tsx Adds notranslate on the live query/report results container to avoid translate-induced DOM detachment during streaming updates.
frontend/pages/policies/edit/components/PolicyResults/PolicyResults.tsx Adds notranslate on the live policy results container to avoid the same translate-induced React unmount crash.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a0adcef4-99cc-402c-aa31-35cf8d43f0a4

📥 Commits

Reviewing files that changed from the base of the PR and between bfff86e and e360fec.

📒 Files selected for processing (1)
  • changes/fix-48277-live-results-translate-crash
✅ Files skipped from review due to trivial changes (1)
  • changes/fix-48277-live-results-translate-crash

Walkthrough

Compact metadata
Type: Bug fix
Scope: Frontend live-results containers and changelog
Files changed: 3

Changes

The PolicyResults and QueryResults root containers now include the notranslate class, with inline comments explaining that browser auto-translation can interfere with streaming live results and cause NotFoundError during updates or unmounting. A changelog entry was also added for the live report crash fix.

Sequence Diagram(s)

No sequence diagram generated.

Related issues: #48277 - Error page when running live report on Dogfood
Related PRs: None identified
Suggested labels: bug, frontend
Suggested reviewers: None identified

Poem
A live report streamed row by row,
Then translation made the DOM say no;
With notranslate in place,
The crash lost its chase,
And results kept flowing just so.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main fix: preventing live results errors from browser auto-translate.
Description check ✅ Passed Includes the required issue reference, problem/solution summary, reproduction steps, and QA details; the template is mostly satisfied.
Linked Issues check ✅ Passed The change blocks auto-translation on the live-results containers, which matches the Chrome-on-macOS streaming error reported in #48277.
Out of Scope Changes check ✅ Passed No unrelated code changes are evident; the changelog entry and translation guards are directly tied to the reported bug.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-48277-live-results-translate-crash

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.01%. Comparing base (6ba04b0) to head (e360fec).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #48705   +/-   ##
=======================================
  Coverage   68.01%   68.01%           
=======================================
  Files        3680     3680           
  Lines      233953   233953           
  Branches    12307    12307           
=======================================
  Hits       159132   159132           
  Misses      60502    60502           
  Partials    14319    14319           
Flag Coverage Δ
frontend 58.96% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lucasmrod lucasmrod merged commit 6e5eb27 into main Jul 6, 2026
26 checks passed
@lucasmrod lucasmrod deleted the fix-48277-live-results-translate-crash branch July 6, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error page when running live report on Dogfood

3 participants