fix(mobile): expanding a live tool-call row no longer crashes the thread #37735
main fromrefs/pull/37735/head·merged by juliusmarminge View on GitHubExpanding a row in a tool-call group while a turn was still streaming could crash the thread view. Fabric sometimes measures a list row before it has a layout and reports its height as NaN. Legend List stored that, so the list's total size became NaN, and since NaN never equals itself its store kept handing React a new snapshot until React gave up.
Our Legend List patch now skips sizes that aren't finite numbers. The row's own layout event reports the real size right after.
Fixes #34031 Reproduced on an Android emulator by expanding rows in a live replay group. Before the fix, every NaN measurement reached the list and one run crashed. After it, 6 runs skipped 3 NaN measurements with no loop.
- 1
yashranaway(GitHub profile, opens in a new tab) linked this to fix #34031
tanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Approvability#
Verdict: Approved at
7f0e55aMacroscope's review found this PR approvable — The patch skips invalid native list measurements that can trigger a rendering loop when expanding live tool-call rows. Its effects are limited to mobile layout handling, with emulator runs supporting the fix and no changes to product defaults or stored data.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).juliusmarminge added labelstakeover:in-progress
No actionable comments were generated in the recent review.
Walkthrough
-
The patch changes MVCP restoration in both React Native builds for qualifying end-following size changes. It also skips item-size measurements when the dimension selected for the current orientation is non-finite.
Changes: React Native list stability
Layer / File(s) Summary End-following MVCP restoration
patches/@legendapp__list@3.7.2.patchFor qualifying size-only changes, the restore logic clamps the offset to the new end when needed and requests an adjustment only when the difference exceeds MVCP_POSITION_EPSILON. If the conditions no longer hold at restoration time, it uses the default MVCP restore.Finite size measurement filtering
patches/@legendapp__list@3.7.2.patchBoth React Native builds skip measurements when the width or height selected for the current orientation is non-finite. Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related PRs
- pingdotgg/t3code#33200: Upgrades
@legendapp/listto 3.7.2, the package version targeted by this patch. - pingdotgg/t3code#28125: Upgrades to
@legendapp/list3.7.2 and removes the prior patch and app-specific scrolling workarounds.
Suggested reviewers:
juliusmarminge - pingdotgg/t3code#33200: Upgrades
Merge Risk:
Low · up to00f53-
This change prevents a reported crash in the mobile thread view when a tool-call group expands during streaming. Remaining uncertainty is limited to scroll position and row-height recovery edge cases. These are low risk, and the change is easy to revert.
Pre-merge checks:
3 · 1-
Failed checks: 1 inconclusiveCheck name Status Explanation Resolution Out of Scope Changes check The NaN skip in the Legend List patch is in scope for [ #34031]. The raw summary also reports a specialized MVCP restore in the same patch. It applies when end-following is active, data is unchanged, a…Describe the MVCP restore change in the PR description. Explain how it relates to the NaN measurement loop or to #34031. If it is not needed for the fix, move it to a separate PR or remove it. Add reproduction or test evidence for the MVCP … Passed checks: 3 passed-
Check name Status Explanation Title check The title names a fix for expanding a live tool-call row. The description and objectives describe a NaN row-height measurement crash in the mobile thread view. The raw summary covers a Legend List pat… Description check The description covers the Problem, Change, and Verification sections clearly. It explains the NaN measurement path, the fix, and the Android emulator reproduction with run counts. The Scope section i… Linked Issues check Requirement [ #34031]: the Android thread view must stay usable while tool activity streams, without the "Maximum update depth exceeded" error in the grouped work-log list. The PR patches Legend List t…Full details: Title check
-
Explanation
The title names a fix for expanding a live tool-call row. The description and objectives describe a NaN row-height measurement crash in the mobile thread view. The raw summary covers a Legend List patch: it adds MVCP restore logic and skips non-finite item-size measurements. The title is related to the NaN-skip part, but the summary also covers an MVCP restore change that the title does not mention. The title names the user-facing symptom, and it does not name the NaN cause. The title also follows the conventional commit form the template asks for.
Full details: Description check
-
Explanation
The description covers the Problem, Change, and Verification sections clearly. It explains the NaN measurement path, the fix, and the Android emulator reproduction with run counts. The Scope section is weak. It links issue
#34031but does not say why the fix needs no issue, and it does not state whether a maintainer asked for the PR. The description does not mention the MVCP restore change in the raw summary. It also does not state any untested areas. These gaps are not critical, so the description is mostly complete.
Full details: Linked Issues check
-
Explanation
Requirement [
#34031]: the Android thread view must stay usable while tool activity streams, without the "Maximum update depth exceeded" error in the grouped work-log list. The PR patches Legend List to skip non-finite item-size measurements (height or width NaN). The PR description states that before the fix one emulator run crashed with NaN measurements reaching the list, and after the fix six runs skipped three NaN measurements with no update loop. The raw summary confirms the skip is applied in both react-native.js and react-native.mjs builds. The issue states that the root cause is unconfirmed. This PR addresses one plausible mechanism and provides reproduction evidence for it. Evidence is limited to one emulator reproduction and no automated test is described in the summary. The assessment is PASS on the available evidence, with that limitation noted.
-
Full details: Out of Scope Changes check
-
Explanation
The NaN skip in the Legend List patch is in scope for [
#34031]. The raw summary also reports a specialized MVCP restore in the same patch. It applies when end-following is active, data is unchanged, and no interruption, anchor, programmatic scroll, drag, or scroll-content override is present. It clamps the scroll offset and requests an adjustment above MVCP_POSITION_EPSILON. The PR description does not mention this behavior. The summary does not establish whether it is needed to fix the crash or the usability requirement. The change is in the same list component named in the issue, so it is not shown to be unrelated.Resolution
Describe the MVCP restore change in the PR description. Explain how it relates to the NaN measurement loop or to
#34031. If it is not needed for the fix, move it to a separate PR or remove it. Add reproduction or test evidence for the MVCP change if it is retained.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 1d1489d
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
6541a2d5-0be5-4515-836c-c48ca8c1bb24
Commits-
Reviewing files that changed from the base of the PR and between 1d1489d0b8e7448b7f020fc9a6325f593caf147e and 00f53f64140a28c898c23fc16753b59186de05ed.
Files ignored due to path filters: 1-
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
Files selected for processing: 1-
patches/@legendapp__list@3.7.2.patch
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
-
Evidence#
Native Android, Pixel 9 emulator (API 36), portrait 1080×2424, light theme; separate fresh databases with identical synthetic Replay data. Start the grouped-command Replay turn, expand the group, and repeatedly expand command rows while activity streams. Repeat across turns.
Before After 

1d1489d0b8 00f53f6414 Crash recording First live-group run, repeat, scripted run through completion Base crashed after expanding a live command row; backend work completed. A later base repeat did not crash, consistent with the intermittent report. Head remained usable across repeated streaming interactions and after completion. Headers are cropped for privacy. Stills were captured after successive screenshots matched, and captures were visually reviewed before upload.
Seed and Replay fixture generator · Interaction driver
Not shown:
- The internal rejection of NaN measurements was not instrumented; the captures demonstrate the visible crash on base and continued interaction on head.
juliusmarminge added labelstakeover:ready
juliusmarminge removed labelstakeover:in-progress
juliusmarminge merged this375343a
juliusmarminge closed this
juliusmarminge removed labelstakeover:ready
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes