Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Export button in bucket view silently fails: WebView fetches the export but never saves the file

オープン
#228 コメント 9 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 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

  1. Open the app, go to a bucket in the buckets view (e.g. aw-watcher-android-test).
  2. Tap Export for that individual bucket.
  3. 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ActivityWatch/aw-android のほかの issue

ActivityWatch/aw-android の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。