Skip to content

feat(core): back button event on Android, closes #8142 - #16

Open
tomerqodo wants to merge 2 commits into
cursor_combined_20260121_qodo_grep_cursor_copilot_1_base_featcore_back_button_event_on_android_closes_8142_pr162from
cursor_combined_20260121_qodo_grep_cursor_copilot_1_head_featcore_back_button_event_on_android_closes_8142_pr162
Open

feat(core): back button event on Android, closes #8142#16
tomerqodo wants to merge 2 commits into
cursor_combined_20260121_qodo_grep_cursor_copilot_1_base_featcore_back_button_event_on_android_closes_8142_pr162from
cursor_combined_20260121_qodo_grep_cursor_copilot_1_head_featcore_back_button_event_on_android_closes_8142_pr162

Conversation

@tomerqodo

@tomerqodo tomerqodo commented Jan 21, 2026

Copy link
Copy Markdown

Benchmark PR from qodo-benchmark#162


Note

Introduces Android back-button handling and supporting infrastructure.

  • Adds Android AppPlugin that intercepts back presses (navigates webview back or finishes activity) and exposes an exit command; TauriActivity now enables back navigation
  • Wires Android plugin in Rust app plugin setup and extends core app permissions with register_listener/remove_listener
  • Adds app.onBackButtonPress to @tauri-apps/api and updates global bundle to support plugin listener registration/removal
  • Enhances Android Plugin base to support event listeners (registerListener, removeListener, hasListener)
  • Bumps wry to 0.53.4 and updates related lockfile entries; minor cleanup in Android path resolver

Written by Cursor Bugbot for commit 55a5c9a. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

put("canGoBack", this@AppPlugin.webView?.canGoBack() ?: false)
}
trigger(BACK_BUTTON_EVENT, data)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale listeners cause back button to stop working

Medium Severity

After a webview page reload or navigation, JS-registered listeners become stale but remain in the Kotlin listeners map. When handleOnBackPressed runs, hasListener(BACK_BUTTON_EVENT) returns true for these dead channels, so trigger() is called instead of the default back navigation. Since the JS callback no longer exists, the event is lost and the back button appears to do nothing. The load() method doesn't clear listeners, and there's no page lifecycle hook to clean them up.

Fix in Cursor Fix in Web

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.

1 participant