mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-09-19 04:59:59 +00:00
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