Export button in bucket view silently fails: WebView fetches the export but never saves the file
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, kotlin, rust
- Domain
- backend-api-design, mobile
Research direction
Look at the WebView setup in the Android app's code, likely in a fragment or activity that hosts the web UI. The issue is that the WebView lacks a DownloadListener to handle the export request. Check how the web UI triggers the download (likely a blob URL or anchor with download attribute). Implement setDownloadListener to intercept the request and save the file using Android's Storage Access Framework. Test by exporting a bucket and verifying the file picker appears and the JSON is saved.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Kotlin
- Stars
- 270
- Forks
- 57
- Avg merge
- 20h 32m
- Merged PRs (30d)
- 38
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ActivityWatch/aw-android
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ActivityWatch/aw-android#306 ·
Maintainers usually reply within 1 day
-
AuthSettingsActivity crashes on launch (InflateException: Material attributes under AppCompat theme)Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ActivityWatch/aw-android#210 · 7 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ActivityWatch/aw-android#302 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
ActivityWatch/aw-android#300 · 6 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
ActivityWatch/aw-android#296 ·
Maintainers usually reply within 1 day
All issues in ActivityWatch/aw-android
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
AAswordman/Operit#1292 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug webview
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
home-assistant/android#7524 ·
Maintainers usually reply within 1 day
-
Issue: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OpenAPITools/openapi-generator#25021 ·
Maintainers usually reply within 1 day