Export button in bucket view silently fails: WebView fetches the export but never saves the file
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 65/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, kotlin, rust
調査の方向性
Android アプリのコードにある WebView のセットアップを確認してください。おそらく、Web UI をホストしている fragment または activity にあります。問題は、エクスポート要求を処理する DownloadListener が WebView にないことです。Web UI がどのようにダウンロードを開始するかを確認してください(おそらく blob URL または download 属性付きの anchor です)。setDownloadListener を実装して要求をインターセプトし、Android Storage Access Framework を使用してファイルを保存してください。bucket をエクスポートし、ファイルピッカーが表示されて JSON が保存されることを確認してテストしてください。
索引モデルが issue の本文から書いたものです。
説明
Export button in bucket view silently fails: WebView fetches the export but never saves the file
Summary
Tapping Export on a bucket in the Android app does nothing (appears to hang / time out). No file is ever produced, no error is shown, and the app does not crash.
Log capture shows the embedded aw-server-rust successfully generates the export in ~39 ms, but the response is then dropped by the app's WebView so no Android download or Storage-Access-Framework machinery is ever invoked, nothing is written to storage. This looks like the in-app WebView has no DownloadListener wired up to handle the web UI's download.
This reproduces on a fresh install
Environment
| Device | Samsung Galaxy A52s 5G (SM-A528B) |
| Android | 14 (API 34), One UI 6.1 |
| Build | UP1A.231005.007.A528BXXSBGYI3 |
| Security patch | 2025-09-01 |
| ActivityWatch app | 0.12.1b5 (versionCode 33), minSdk 24, targetSdk 34 |
| System WebView | Google Chrome/Android System WebView 150.0.7871.181 |
Steps to reproduce
- Open the app, go to a bucket in the buckets view (e.g.
aw-watcher-android-test). - Tap Export for that individual bucket.
- Observe: nothing happens — no file, no picker, no error, no toast.
Expected behavior
The bucket export JSON is saved to the device (e.g. via a Storage Access Framework "Save to…" picker or the Downloads folder), matching how the desktop web UI download behaves.
Actual behavior
The web UI issues the export request, the local server answers it successfully, and then the file is silently discarded. From the user's perspective it hangs / times out.
Evidence (logcat)
The app renders the bundled web UI inside an Android WebView (a Chromium sandboxed process is spawned for it):
ActivityManager: Start proc 3758:com.google.android.webview:sandboxed_process0:...:0
for {net.activitywatch.android/org.chromium.content.app.SandboxedProcessService0:0}
At the moment Export is tapped, the embedded server handles the request successfully in ~39 ms, then the client (WebView) immediately closes the connection:
I aw-server-rust: rocket::server: GET /api/0/buckets/aw-watcher-android-test/export:
I aw-server-rust: rocket::server: Matched: (bucket_export) GET /api/0/buckets/<bucket_id>/export
I aw-server-rust: rocket::server: Outcome: Success (19:08:28.527 -> 19:08:28.566, ~39 ms)
W aw-server-rust: rocket::server: Remote left: channel closed.
Across the entire attempt, none of Android's file-saving mechanisms fire (grep over the full capture, 0 hits each):
DownloadManager: 0 DownloadListener: 0 ACTION_CREATE_DOCUMENT: 0
documentsui: 0 openOutputStream: 0
There is also no FATAL/AndroidRuntime crash, no ANR, and no OutOfMemory in the log. The response is produced and then goes nowhere.
Likely root cause
The Export action in the bundled aw-webui performs a browser-style download (a blob: / <a download> save that works in a normal browser). Android's WebView does not handle such downloads unless the host app registers a WebView.setDownloadListener(...) (and, for blob: URLs, bridges them to a native save). Without that, the fetched bytes are dropped.
Workaround
Managed to pull the data directly from the phone's local server over ADB, bypassing the WebView:
# On the phone: enable Wireless debugging (Developer options)
adb pair <phone-ip:pairing-port> <6-digit-code>
adb connect <phone-ip:connect-port>
adb forward tcp:5666 tcp:5600
# Per-bucket (reliable):
curl http://localhost:5666/api/0/buckets/<bucket_id>/export -o <bucket_id>.json
- 主要言語
- Kotlin
- スター
- 275
- フォーク
- 60
- 平均マージ
- 20時間 32分
- マージ済み PR(30日)
- 38
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ActivityWatch/aw-android のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ActivityWatch/aw-android#306 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
AuthSettingsActivity crashes on launch (InflateException: Material attributes under AppCompat theme)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
ActivityWatch/aw-android#210 · コメント 7 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
ActivityWatch/aw-android#302 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
ActivityWatch/aw-android#300 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
ActivityWatch/aw-android#296 ·
メンテナーはふだん 1 日以内に返信
ActivityWatch/aw-android の issue をすべて見る
似ている issue
-
go 🏃 testing 🧪
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
valkey-io/valkey-glide#7239 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
ethereum-lists/chains#8788 ·
メンテナーはふだん 1 日以内に返信
-
unconfirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
thunderbird/thunderbird-android#11654 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tauri-apps/tauri#16173 ·
メンテナーはふだん 2 日以内に返信
-
feature
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信