Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#228 9 comments 0 reactions 0 assignees View on GitHub

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

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

  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
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ActivityWatch/aw-android

All issues in ActivityWatch/aw-android

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.