fix(sync): pick up aw-server-rust API-key JNI client and set data dir - #249
Merged
ErikBjare merged 1 commit intoAug 31, 2026
Merged
Conversation
This was referenced Aug 31, 2026
Greptile SummaryThe PR updates the bundled Rust server and configures the separate sync native library to use the app-specific files directory.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Sequence DiagramsequenceDiagram
participant K as SyncInterface
participant N as libaw_sync.so
participant C as filesDir/config.toml
K->>K: Set XDG fallback paths
K->>N: Load aw_sync
K->>N: setDataDir(filesDir)
N->>C: Read sync configuration and API key
Reviews (2): Last reviewed commit: "fix(sync): pick up aw-server-rust API-ke..." | Re-trigger Greptile |
ActivityWatch#247: sync appeared to run but wrote nothing because GET /api/0/buckets 401'd. The JNI client now forwards [auth].api_key (ActivityWatch/aw-server-rust#666). Bump the submodule to 2ded7d7 (includes #666) and call SyncInterface.setDataDir so libaw_sync.so reads filesDir/config.toml on debug and work-profile installs, not only the release user-0 path. Git-Session-Id: e6b1
TimeToBuildBob
force-pushed
the
bump/aw-server-rust-sync-apikey
branch
from
August 31, 2026 15:23
dcf5880 to
0a74595
Compare
Contributor
Author
|
@greptileai review |
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. |
Judemasic
added a commit
to Judemasic/aw-android
that referenced
this pull request
Sep 2, 2026
Takes ActivityWatch#250 (shared DeviceHostname helper), ActivityWatch#242, ActivityWatch#234, ActivityWatch#244, ActivityWatch#248, ActivityWatch#245. Deliberately NOT taken: ActivityWatch#249's Kotlin half. It declares private external fun setDataDir(path: String) and calls it from SyncInterface's init block, but this fork's android.rs exports no Java_..._SyncInterface_setDataDir - the constructor would throw UnsatisfiedLinkError and SyncScheduler would disable itself, which is Blocker 6 verbatim. This fork already gets the same fix via XDG_DATA_HOME (step 1.0b), which needs no new JNI symbol. The refusal is documented at the call site so the next merge re-checks it. Submodule pointer kept at our fork (c6f7df2); upstream's 2ded7d7 has none of the aw-sync fixes from Phase 1. getDeviceName() now delegates to upstream's deviceHostname(), which is byte-for-byte equivalent to the implementation it replaces - no device directory in the shared folder changes name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to ActivityWatch/aw-server-rust#666 (merged). Ships the v0.14.0b2 sync 401 fix into the app (ActivityWatch/aw-android#247).
Problem
Sync appeared to run but the chosen folder never changed:
GET /api/0/buckets401'd because the Android JNI client did not forward[auth].api_keyfromfilesDir/config.toml.Fix
aw-server-rust77defef→2ded7d7(includes #666).SyncInterface.setDataDir(filesDir)afterloadLibrary("aw_sync").libaw_sync.sohas its ownANDROID_DATA_DIRstatic;RustInterface.setDataDironly updateslibaw_server.so. The hardcoded default is the release user-0 path — debug (.debugsuffix) and work-profile installs still 401 without this.XDG env (
XDG_DATA_HOME=$filesDir/data) stays as the fallback for current Kotlin that had not calledsetDataDir.Also picked up in the same bump: #654 (Rust panics to logcat, #220), #657, #658, #660, #661, #642.
Does not close #247: remaining items are sync UX/discoverability and category-import save persistence.
Testing
Java_net_activitywatch_android_SyncInterface_setDataDirpresent at the pinned SHA.:mobile:compileDebugKotlinnot run here (no JAVA_HOME on this host); CI build is the check.