Skip to content

[Android] A main pipe getter that times out aborts the process when the late reply arrives #1903

Open

Description

@LucaCappelletti94

Describe the bug

On Android, when the UI thread stays busy for longer than MAIN_PIPE_TIMEOUT, WebView::url() returns its timeout error as expected, but the process aborts a moment later. url() waits for the reply with recv_timeout and drops the receiver when it gives up. Once the UI thread is free it handles the queued GetUrl, and the unwrap on the reply send panics with SendError inside the main pipe callback, which aborts the process.

The other replies on the main pipe unwrap their sends the same way on dev, for GetWebViewVersion, CanGoForward and CanGoBack and GetCookies, so webview_version(), can_go_forward(), can_go_back(), cookies() and cookies_for_url() would abort the same way after a timeout.

Steps To Reproduce

https://github.com/LucaCappelletti94/wry-android-main-pipe-timeout-repro uses tao 0.37 and wry 0.57.0 without Tauri. At startup it keeps the UI thread busy for 11 s through wry::prelude::dispatch, then calls webview.url() on the event loop thread.

cargo install --locked cargo-mobile2
ANDROID_SERIAL=emulator-5554 ./repro.sh

All 3 cold starts on an Android 15 x86_64 emulator print the timeout from url() and then abort:

REPRO UI thread busy for 11000 ms
REPRO url() returned after 10000 ms: Err("timed out waiting on receive operation")
REPRO UI thread free
thread '<unnamed>' (10455) panicked at .../wry-0.57.0/src/android/main_pipe.rs:421:24:
called `Result::unwrap()` on an `Err` value: "SendError(..)"

Expected behavior

url() returns the timeout error, and the process keeps running when the UI thread later handles the stale GetUrl.

Platform and Versions (please complete the following information):
OS: Android 15 (API 35) x86_64 emulator, Android System WebView 124.0.6367.219, built on Ubuntu 24.04
Rustc: 1.101.0-nightly (4ebd25825 2026-10-15)
wry 0.57.0, tao 0.37.1

Additional context

tauri-apps/tauri#16379 reaches this abort through a deadlock between Tauri's event loop and the UI thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions