Repository: react
Issue: [DevTools Bug] getCommitTree(): Invalid commit "7" for root "1". There are only "7" commits.
Labels: Type: Bug,Status: Unconfirmed,Component: Developer Tools

### Website or app

private

### Repro steps

profile re-renders click on individual re-renders. Clicked on the last re-render and it crashed instead of displaying info.

### How often does this bug happen?

Only once

### DevTools package (automated)

react-devtools-extensions

### DevTools version (automated)

6.0.0-d66fa02a30

### Error message (automated)

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

### Error call stack (automated)

```text
ve/<@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1159236
CommitFlamegraphAutoSizer@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1404914
renderWithHooks@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:52244
updateFunctionComponent@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:81718
beginWork@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:95937
performUnitOfWork@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:154622
workLoopSync@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:154498
renderRootSync@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:154249
performWorkOnRoot@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:149824
performSyncWorkOnRoot@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:164884
flushSyncWorkAcrossRoots_impl@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:163205
processRootScheduleInMicrotask@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:163662
1519/ensureRootIsScheduled/<@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:162805
```


### Error component stack (automated)

```text
CommitFlamegraphAutoSizer@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1404715
div@unknown:0:0
div@unknown:0:0
div@unknown:0:0
SettingsModalContextController@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1297733
wl<@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1536567
fa@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1315530
div@unknown:0:0
div@unknown:0:0
ThemeProvider@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1318230
portaledContent/<@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1318420
div@unknown:0:0
div@unknown:0:0
div@unknown:0:0
ThemeProvider@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1318230
TimelineContextController@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1395885
ProfilerContextController@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1387636
TreeContextController@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1209953
SettingsContextController@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1238133
ModalDialogContextController@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1375334
DevTools_DevTools@moz-extension://beb769c0-41a5-4f80-ba39-12fab791919f/build/main.js:1:1544294
```


### GitHub query string (automated)

```text
https://api.github.com/search/issues?q=getCommitTree(): Invalid commit  for root . There are only  commits. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react
```