Skip to content

[DevTools] Fix commit index reset when switching profiler roots#35672

Merged
hoxyq merged 1 commit intomainfrom
fix-profiler-commit-index-on-root-switch
Feb 3, 2026
Merged

[DevTools] Fix commit index reset when switching profiler roots#35672
hoxyq merged 1 commit intomainfrom
fix-profiler-commit-index-on-root-switch

Conversation

@hoxyq
Copy link
Contributor

@hoxyq hoxyq commented Feb 2, 2026

Fixes #31463, #30114.

When switching between roots in the profiler flamegraph, the commit index was preserved from the previous root. This caused an error "Invalid commit X. There are only Y commits." when the new root had fewer commits than the selected index.

This fix resets the commit index to 0 (or null if no commits) when the commitData changes, which happens when switching roots.

@hoxyq hoxyq requested review from emily8rown and eps1lon February 2, 2026 15:21
@meta-cla meta-cla bot added the CLA Signed label Feb 2, 2026
When switching between roots in the profiler flamegraph, the commit
index was preserved from the previous root. This caused an error
"Invalid commit X. There are only Y commits." when the new root had
fewer commits than the selected index.

This fix resets the commit index to 0 (or null if no commits) when the
commitData changes, which happens when switching roots.
@hoxyq hoxyq force-pushed the fix-profiler-commit-index-on-root-switch branch from 394243e to d8dd1d8 Compare February 2, 2026 20:41
@hoxyq
Copy link
Contributor Author

hoxyq commented Feb 2, 2026

Switched to invalidating by keeping commitData in a state and checking referential equality

@hoxyq hoxyq merged commit 5dad2b4 into main Feb 3, 2026
267 of 282 checks passed
@hoxyq hoxyq deleted the fix-profiler-commit-index-on-root-switch branch February 3, 2026 12:44
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.

[DevTools Bug] getCommitTree(): Invalid commit "7" for root "1". There are only "7" commits.

2 participants