Skip to content

[DevTools] Ignore duplicate commit tree adds - #36474

Open
yudin-s wants to merge 2 commits into
react:mainfrom
yudin-s:fix-devtools-duplicate-commit-node
Open

[DevTools] Ignore duplicate commit tree adds#36474
yudin-s wants to merge 2 commits into
react:mainfrom
yudin-s:fix-devtools-duplicate-commit-node

Conversation

@yudin-s

@yudin-s yudin-s commented May 14, 2026

Copy link
Copy Markdown

Summary

Fixes #36124.
Fixes #36006.

The Profiler commit tree can receive duplicate add operations for a fiber that is already present in the reconstructed tree. Instead of throwing while rendering Profiler charts, skip the duplicate add payload and continue applying later operations for that commit.

How did you test this change?

  • yarn test --build --project devtools packages/react-devtools-shared/src/tests/profilingCommitTreeBuilder-test.js --runInBand

@meta-cla meta-cla Bot added the CLA Signed label May 14, 2026

@eps1lon eps1lon 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.

The test should reproduce the duplicate tree add instead of manually forcing one. The duplicate add would be the bug that needs fixing instead of just ignoring it.

@yudin-s
yudin-s requested a review from eps1lon May 29, 2026 18:11

// Replay a duplicated payload using the same snapshot and operations shape
// that ProfilerStore records from the renderer.
dataForRoot.operations.push(dataForRoot.operations[0].slice());

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.

Is that part of the public API? This looks like it's using internals triggering the bug instead of legit usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants