Moe Hamade 3bdaf2ae59 fix(ui): forward Back when the handler's enabled state is stale
BackHandler's enabled flag trails the state it is derived from by a
dispatch and a recomposition, so a second quick press after the last
overlay closes still reaches this handler. handleBackPressed then finds
nothing to unwind and returns false, and dropping that result swallowed
the press instead of leaving the chat screen.

The result is now forwarded: pop a route if one is beneath, and otherwise
finish, which is what the press would have done had the handler already
been disabled. This mirrors the guard the callback carried before the
Navigation 3 host replaced it.

Not covered by a test. The condition is a race between input dispatch and
recomposition inside a composed hierarchy, and this project cannot host a
Compose unit test yet: isIncludeAndroidResources fails 24 existing tests
with "targetSdkVersion=37 > maxSdkVersion=35", and pinning Robolectric to
sdk 35 fails 109.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LgmKvwg6yjo1cEmagppK9m
2026-09-08 21:54:48 +03:00
..
2025-12-14 21:55:41 +07:00
2026-07-29 03:41:16 +02:00