Skip to content

chore(submodule): bump aw-server-rust to 05c7b38 — stream export headers - #305

Open
TimeToBuildBob wants to merge 5 commits into
ActivityWatch:masterfrom
TimeToBuildBob:bump/aw-server-rust-05c7b38
Open

TimeToBuildBob wants to merge 5 commits into
ActivityWatch:masterfrom
TimeToBuildBob:bump/aw-server-rust-05c7b38

Conversation

@TimeToBuildBob

Copy link
Copy Markdown
Contributor

Bumps the aw-server-rust submodule from 70ba50d to 05c7b38.

This is the remaining carrier for #228 after
#304 (native stream-to-cache-file, already on
master). Erik reproduced on 0.14.2b4: small-bucket JSON/CSV works, but
"Export all buckets as JSON" on ~500k events crawls then no-ops, and the
largest bucket fails as JSON or CSV.

ActivityWatch/aw-server-rust#721 sends HTTP headers before serializing,
so the native fetch (connect + readTimeout=120s in #304) does not
block on getResponseCode() until the whole JSON is written.

Also picks up along the way:

Not in this pin:

Does not close #228 until a device confirms
"Export all buckets as JSON" on ~500k events.

Picks up ActivityWatch/aw-server-rust#721: send HTTP headers before
serializing large exports, so "Export all buckets as JSON" on ~500k
events opens the connection during processing instead of waiting for
the full body. Native Android fetch (ActivityWatch#304)
already streams the body to a cache file; without this bump it still
blocks on headers until serialization finishes.

Also picks up:
- ActivityWatch/aw-server-rust#718 — aw-sync dedupe CLI (JNI path unused)
- ActivityWatch/aw-server-rust#719 — aw-sync v2 writer, feature-flagged
- ActivityWatch/aw-server-rust#720 — install-ndk.sh macOS readlink
- aw-webui bump to #988 (not #993)

ActivityWatch#228

Git-Session-Id: ba128b8a-fc85-51b5-90c0-4c7a4beaed85
@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

Review guide (auto-posted)

Structured warm-up for reviewers — what changed, what to run, where to look.

Key files

  • aw-server-rust (+1/-1, Δ2)

Suggested verification

  • Run the repo's usual CI-equivalent checks locally

Known risks / watch points

  • No automatic high-risk tags; use file list + diff for judgment.

Suggested review focus

  • Confirm behavior matches the PR description acceptance criteria.
  • Skim the largest diffs first (listed above).
  • If CI is green, spot-check the highest-risk paths called out here.

Generated by scripts/github/pr-warmup-review-guide.py for #305.

@greptile-apps

greptile-apps Bot commented Sep 23, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The submodule bump appears safe to merge, with no concrete defects identified in the changed revision pointer or its Android integration.

Summary

The PR advances the bundled aw-server-rust revision to include early HTTP export headers, allowing Android’s native streaming export path to begin reading large JSON responses without waiting for complete serialization.

  • Carries the server-side complement to the existing Android stream-to-cache-file export implementation.
  • Also incorporates upstream sync, NDK setup, and embedded web UI updates.
  • No concrete correctness, security, or repository-rule violations were identified.

Diagram

sequenceDiagram
    participant UI as Embedded dashboard
    participant Android as Android export interceptor
    participant Server as aw-server-rust
    participant Cache as Android cache file
    UI->>Android: Request JSON export
    Android->>Server: Authenticated native HTTP request
    Server-->>Android: Send response headers promptly
    Server-->>Android: Stream serialized JSON body
    Android->>Cache: Stream response to cache
    Android-->>UI: Open Android save/share flow
Loading

Reviews (1) · Last reviewed commit: "chore(submodule): bump aw-server-rust to..."

The test already set hasMigratedHostname, but startup uses the distinct
sanitizedHostnameMigratedTo flag. Without it, Java opens the 17MB seeded
sqlite.db while the rust worker switches journal_mode to WAL, hits
SQLITE_BUSY, panics, and leaves events/count returning 500.

Git-Session-Id: 523c0c0e-38a3-5992-bcb3-bf6bf0d76080
@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

E2E Test E2E (29) failed on UpgradeWithHistoryTest.serverAnswersWhileLegacyHistoryMigrates (legacy events were not merged within 60000 ms). Not the export-header bump — 70ba50d..05c7b38 does not touch aw-datastore.

Logcat from run 35826089151: rust worker panics at journal_mode=WAL with database is locked, then events/count returns 500 (datastore worker is gone) for the rest of the wait. /api/0/info still answers, so the 20s ready wait passed.

Cause: the fixture set hasMigratedHostname but startup uses the distinct sanitizedHostnameMigratedTo flag. Java opened the 17MB seeded sqlite.db to rewrite hostnames while the worker switched WAL.

Pushed b908cfd so the fixture also sets sanitizedHostnameMigratedTo. CI queued on the new head.

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click.

This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted.

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

E2E Test E2E (29) on run 35828479752 failed on NativeWindowInsetsTest.rotatingMainActivityKeepsTheSameWebView — "Instrumentation run failed due to Process crashed" — a different test from the previous run's failure. Two runs, two distinct E2E tests, both crashing on the software-rendered emulator (no KVM): classic environment flakiness.

This PR only bumps aw-server-rust (Rust server code). Neither rotation behaviour nor WebView identity is touched. Pushed an empty commit to re-trigger CI.

UpgradeWithHistoryTest left the compiled INSERT statement open. SQLiteStatement
holds a SQLiteClosable ref, so db.close() did not drop the last reference and
the Java connection stayed alive. rust then panicked on the v6 exclusive index
migration (`database is locked`) and events/count stayed 500 for the rest of
the 60s wait.

Also delete leftover -wal/-shm after close.

Git-Session-Id: 858a0c7e-764d-5961-a03a-156ec4922b8d
@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

E2E Test E2E (29) on run 35831060120 failed on UpgradeWithHistoryTest again (legacy events were not merged within 60000 ms). The hostname-skip in b908cfd did stop the WAL journal_mode panic; the worker then died later on the v6 exclusive index migration:

Failed to run v6 migration transaction: database is locked (aw-datastore/src/datastore.rs:223).

Cause: the 17MB seed left its compiled INSERT SQLiteStatement open. That statement holds a SQLiteClosable ref, so db.close() did not drop the last reference and the Java connection stayed alive across process startup. rust's BEGIN EXCLUSIVE then hit SQLITE_BUSY (5s busy_timeout), panicked, and events/count stayed 500.

Pushed f4cce4c — close the statement before db.close(), and delete leftover -wal/-shm. CI queued on the new head. Not merge-ready until this E2E run is green.

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

E2E Test E2E (29) on run 35833630532 failed on NativeWindowInsetsTest.syncToggleReceivesRealTap — "A screen tap must change the persisted setting expected: but was:". This is an emulator UI-tap flake: the test already has retry logic with readiness polling (tapUntilPrefChanges, up to 3 attempts, bounds-stable wait), added specifically because the software-rendered CI emulator (no KVM) is slow to settle between activities. The failure is unrelated to the aw-server-rust bump. Pushed 27ad04b to re-trigger CI.

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

E2E Test E2E (29) is green on 27ad04b (run 35836334678). Unit Test also green. MERGEABLE.

The previous failure on f4cce4c (run 35833630532) was NativeWindowInsetsTest.syncToggleReceivesRealTap — emulator tap flake, not the rust bump. Empty retrigger was the measurement; it passed.

Waiting on a maintainer merge (pull-only on this repo). Does not close #228 until a device confirms the large JSON export.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant