Skip to content

fix(session): keep the background work capsule's height from going negative - #335

Merged
Tarquinen merged 2 commits into
devfrom
crash-334
Nov 27, 2026
Merged

Tarquinen merged 2 commits into
devfrom
crash-334

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

The app crashed for some users with an IllegalArgumentException while drawing a session that had background work (a subagent or shell running). Play reports it on version 1035, on API 37 OnePlus phones.

The capsule's height is its place's height minus 5dp top and bottom. A place under 10dp tall made that negative, and Constraints.fixed threw in the next layout. The place gets that short when the composer has almost no height left, for example in a split screen or a small window with the keyboard up, or when a clip above it cuts it.

Now the capsule's height stops at zero. At normal sizes nothing changes, so there is no media.

  • I decoded the Play stack with the release's R8 mapping: it lands on this Constraints.fixed call, measured from a draw pass. It is not the RectManager crash from Crash: IllegalArgumentException in InlineClassHelperKt.throwIllegalArgumentException #242.
  • I didn't find the layout that does this on the reporters' phones, and I didn't reproduce it in the app on a device.
  • A throwaway Robolectric test that laid the capsule's place out 4dp tall threw the same IllegalArgumentException on dev and passed with the fix. It isn't in the PR.

Fixes #334

…gative

The capsule's height is its place's height minus 5dp top and bottom. A place under 10dp tall made it negative, and the next layout threw IllegalArgumentException from Constraints.fixed. That happens when a short window squeezes the composer's pill row, or when a clip cuts the place. The height now stops at zero.

Fixes #334
The fix is a one-line clamp; the Robolectric test isn't needed.
@Tarquinen
Tarquinen merged commit 349707b into dev Nov 27, 2026
2 checks passed
@Tarquinen
Tarquinen deleted the crash-334 branch November 27, 2026 17:04
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.

Crash: IllegalArgumentException in x85.a

1 participant