Skip to content

chore(submodule): bump aw-server-rust to master (c535d77) - #305

Merged
ErikBjare merged 9 commits into
ActivityWatch:masterfrom
TimeToBuildBob:bump/aw-server-rust-05c7b38
Oct 10, 2026
Merged

ErikBjare merged 9 commits into
ActivityWatch:masterfrom
TimeToBuildBob:bump/aw-server-rust-05c7b38

Conversation

@TimeToBuildBob

@TimeToBuildBob TimeToBuildBob commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Refresh (2026-10-10)

Re-pointed to aw-server-rust master c535d77 and merged current aw-android master. Since the previous pin 9008520, that adds 14 merged server commits, including:

Android master still pins 70ba50d, so none of these reach the app until this merges. Not included yet: ActivityWatch/aw-webui#1061 (merged 2026-10-06 21:05, after the server's last aw-webui bump), which aw-android#321 items 3/7/8 need. That requires an aw-webui bump in aw-server-rust first, then a re-bump here.


Summary

Bumps aw-server-rust submodule to 9008520 (master as of 2026-10-02), which includes:

  • #721 / #722: stream headers before body on JSON and CSV export endpoints (fixes large export hangs)
  • #770: bump bundled aw-webui to include #997 (server-side CSV generation replacing in-browser materialization)
  • Various aw-client-rust, aw-sync, and transform fixes

Together these fix #228: Export button silently fails for large datasets.

Testing

  • Large single-bucket CSV export should now stream instead of blocking until full response body is ready
  • JSON export path already fixed by #304

Fixes #228

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

[High risk] Bumps the Rust backend submodule with test changes.

No actionable new issue or outstanding previous finding is established by the available review evidence.

Summary

The PR advances the bundled Rust server pointer to 9008520 and adjusts the large-history Android upgrade test to avoid competing database access during startup.

  • The test marks the already-sanitized fixture hostname as migrated.
  • It closes the prepared statement and database before removing SQLite sidecar files.

Reviews (2) · 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.

@TimeToBuildBob

TimeToBuildBob commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 AI code review

Safe to merge — no P0/P1 findings on latest review

Updated after inline dispositions on finding threads — this is the current state; the verdict below is frozen at review time and is kept as the historical record of that pass.

Finding disposition
Finding Severity State
mobile/src/androidTest/java/net/activitywatch/android/UpgradeWithHistoryTest.kt:220 P2 superseded by latest review (not reproduced)
mobile/src/androidTest/java/net/activitywatch/android/UpgradeWithHistoryTest.kt:95 P2 rejected

Bumps the aw-server-rust submodule from 70ba50dd to c535d77a and adjusts the UpgradeWithHistoryTest instrumentation: sets the sanitizedHostnameMigratedTo preference, wraps the seed inserts in a try/finally that closes the compiled SQLiteStatement, and deletes the -wal/-shm files after closing the seeded database.

Needs a look — P2 only

Confidence 4/5

1 finding · ⚠️ 1 P2

⚠️ P2 medium — mobile/src/androidTest/java/net/activitywatch/android/UpgradeWithHistoryTest.kt:95

The test is supposed to simulate an upgrading install with both buckets present and six-figure history, but this line pre-seeds sanitizedHostnameMigratedTo to the current hostname. The comment on lines 91-94 explains that without that preference, startup opens sqlite.db from Java to rewrite bucket hostnames while the rust worker is switching journal_mode to WAL, racing SQLITE_BUSY, panicking the worker, and leaving events/count at 500. A real upgrade from a release before this preference existed would not have it set, so it would still hit that race. The test therefore skips exactly the startup path that the regression was about and passes while the production failure remains for users upgrading large histories; CI no longer detects the worker panic.

If the production code sanitizes hostnames, seed the sanitized value, e.g. .putString("sanitizedHostnameMigratedTo", hostname.lowercase()) or whatever the production sanitization does.

How this was verified: Checked the test file: hostname comes from deviceHostname(context) at line 83, and the preference is set to that raw value. The production code that reads sanitizedHostnameMigratedTo is in the Rust server or Java migration code, not in this diff, so I cannot confirm the exact sanitization, but the key name implies sanitization is applied. If the production code sanitizes before comparing, the raw hostname will not match.

Consensus: 2/3 passes agreed — pass 3 looked and disagreed
Distinct keys: 1 (general)

Files changed (2) — the diff as I read it
  • aw-server-rust — Updates the submodule pointer from 70ba50ddc3852acadfb5e90ab20d54e04d8a60b2 to c535d77af495681e4b3960c4e4f5991e1c04a3c7.
  • mobile/src/androidTest/java/net/activitywatch/android/UpgradeWithHistoryTest.kt — Sets sanitizedHostnameMigratedTo, closes the event insert statement in a finally block, and removes -wal/-shm files after seeding.
Previous review passes
commit score findings engine when
27ad04b43e67 5/5 0 llm 2026-09-25 10:27 UTC
173e6335edec 5/5 0 llm 2026-10-02 15:03 UTC
173e6335edec 5/5 0 llm 2026-10-09 03:05 UTC
5cea4169cd2f 4/5 2 llm 2026-10-10 03:22 UTC

Reviewed 5cea4169cd2f · openrouter/deepseek/deepseek-v4-flash-0731 · llm engine · 1099s · about this reviewer

Maintainer commands

@TimeToBuildBob review (own line) — fresh review · @TimeToBuildBob fix — a worker acts on the findings. Once per comment; 👀 = received.

@TimeToBuildBob TimeToBuildBob changed the title chore(submodule): bump aw-server-rust to 05c7b38 — stream export headers chore(submodule): bump aw-server-rust for streaming exports Sep 27, 2026
@TimeToBuildBob
TimeToBuildBob marked this pull request as draft September 27, 2026 15:58
@TimeToBuildBob
TimeToBuildBob marked this pull request as ready for review October 2, 2026 09:04
…ust-305-6013

Git-Session-Id: fc35e8e9-b0fa-4a6e-ba93-9b6c85e93881
Carries 14 merged server fixes since 9008520, including the idempotent v3->v4 key_value migration (#792), stopwatch commit-before-ack (#743), in-place re-import (#766), and negative-duration rejection.

Git-Session-Id: fc35e8e9-b0fa-4a6e-ba93-9b6c85e93881
@TimeToBuildBob TimeToBuildBob changed the title chore(submodule): bump aw-server-rust for streaming exports chore(submodule): bump aw-server-rust to master (c535d77) Oct 10, 2026
@ErikBjare
ErikBjare merged commit 4633f23 into ActivityWatch:master Oct 10, 2026
8 checks passed
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

2 participants