Skip to content

Fix cargo warnings#619

Draft
0xbrayo wants to merge 1 commit into
ActivityWatch:masterfrom
0xbrayo:fix-cargo-warnings
Draft

Fix cargo warnings#619
0xbrayo wants to merge 1 commit into
ActivityWatch:masterfrom
0xbrayo:fix-cargo-warnings

Conversation

@0xbrayo

@0xbrayo 0xbrayo commented Jun 13, 2026

Copy link
Copy Markdown
Member

No description provided.

@0xbrayo
0xbrayo marked this pull request as draft June 13, 2026 12:29
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.76%. Comparing base (656f3c9) to head (d8b0826).
⚠️ Report is 75 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #619      +/-   ##
==========================================
+ Coverage   70.81%   75.76%   +4.94%     
==========================================
  Files          51       62      +11     
  Lines        2916     5030    +2114     
==========================================
+ Hits         2065     3811    +1746     
- Misses        851     1219     +368     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@greptile-apps

greptile-apps Bot commented Jun 13, 2026

Copy link
Copy Markdown

Greptile Summary

Despite the "Fix cargo warnings" title, this PR bundles three distinct changes: upgrading reqwest from 0.11 → 0.12 (and its transitive dependency chain), silencing dead-code warnings with #[allow(dead_code)], and adding a substantial new opt-in compression-zstd feature that stores event data as zstd-dictionary-compressed BLOBs with a DB schema version bump from 5 → 6.

  • reqwest 0.11 → 0.12 upgrade (aw-client-rust, aw-sync): straightforward bump; Cargo.lock reflects the new hyper/rustls/h2 stack.
  • compression-zstd feature (aw-datastore): adds compression.rs, a v5→v6 migration, startup training/backfill logic, and updated read/write paths — all gated on the feature flag.
  • close() removal from AccessMethod trait (aw-sync): callers use concrete Datastore::close() directly, so no breakage.

Confidence Score: 3/5

The reqwest upgrade and warning-suppression changes are safe to merge; the compression feature should not be shipped until the fallback panic in the event-read path is fixed.

Both get_event and get_events_inner call .unwrap() on serde_json::from_str after substituting raw binary bytes when decompression fails. A compressed database opened without the feature panics the DatastoreWorker thread, making the datastore permanently unavailable.

aw-datastore/src/datastore.rs — the get_event and get_events_inner decompression fallback paths

Important Files Changed

Filename Overview
aw-datastore/src/datastore.rs Adds DB v6 migration, ensure_compression/train_and_backfill startup logic, and updated event read paths; the decompression fallback in both get_event and get_events_inner calls .unwrap() on potentially non-JSON bytes, causing a worker-thread panic.
aw-datastore/src/compression.rs New module implementing opt-in zstd dictionary compression; roundtrip logic is sound but json.len() as u32 can silently truncate for very large payloads.
aw-datastore/src/worker.rs Adds foreign_keys = ON pragma before migrations; correct.
aw-datastore/tests/datastore.rs Updates v6 version assertion and adds a feature-gated compression round-trip integration test.
aw-sync/src/accessmethod.rs Removes close() from the AccessMethod trait safely.
aw-client-rust/Cargo.toml Upgrades reqwest from 0.11 to 0.12.

Reviews (1): Last reviewed commit: "fix: resolve cargo build warnings" | Re-trigger Greptile

Comment thread aw-datastore/src/datastore.rs Outdated
Comment thread aw-datastore/src/datastore.rs Outdated
Comment thread aw-datastore/src/compression.rs Outdated
@0xbrayo
0xbrayo force-pushed the fix-cargo-warnings branch from 3c5a5aa to f89b653 Compare July 19, 2026 13:15
@0xbrayo
0xbrayo force-pushed the fix-cargo-warnings branch from f89b653 to d8b0826 Compare July 19, 2026 13:18
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.

1 participant