Skip to content

fix(drawer): skip the hold wait when the long-press timeout is 80 ms or less - #355

Merged
Tarquinen merged 1 commit into
devfrom
crash-351
Nov 29, 2026
Merged

Tarquinen merged 1 commit into
devfrom
crash-351

Conversation

@Tarquinen

Copy link
Copy Markdown
Member

The app crashed whenever someone touched and held a session row in the drawer with Android's touch-and-hold delay set to 80 ms or less. Google Play reported it from one phone.

The drawer waits 80 ms for a press, then waits the rest of the long-press timeout for the hold. With a long-press timeout of 80 ms or less that second wait got a timeout of 0 or below, and Compose's withTimeout then resumes the pointer wait that the first timeout had already resumed, which throws "Already resumed". Now the second wait is skipped when no time is left, so the hold starts at 80 ms.

Nothing visible changes at normal settings.

  • Reproduced on dev on an emulator: settings put secure long_press_timeout 80, open the drawer, hold a session row. It crashed with the same stack as Play's reports ("Timed out waiting for 0 ms"). With the fix the hold chooses the row for selection, and a tap still opens it. At the default 400 ms, hold and tap work as before. scripts/check.sh passes.
  • No regression test: no module has a Compose UI test setup to drive a pointer gesture. The test would hold a row under a ViewConfiguration with an 80 ms long-press timeout and expect held to be called without a crash.

Fixes #351

…or less

Holding a drawer row crashed with "Already resumed" when the platform
long-press timeout was 80 ms or less: the second awaitTouch got a timeout
of 0 or below, and Compose's withTimeout then resumes the pointer awaiter
the first timeout already resumed. The hold wait is now skipped when no
time is left, so the hold starts at the 80 ms press delay.

Verified: reproduced on dev on the emulator with long_press_timeout 80
(same stack as Play's); with the fix a hold selects the row and a tap
opens it, at 80 ms and at the default 400 ms. scripts/check.sh passes.

Fixes #351
@Tarquinen
Tarquinen merged commit 9f6abb5 into dev Nov 29, 2026
3 checks passed
@Tarquinen
Tarquinen deleted the crash-351 branch November 29, 2026 23:24
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: IllegalStateException in DrawerRowInteractionKt$drawerRowInteraction$1$1$1$1.invokeSuspend$awaitTouch

1 participant