aw-sync: 15 reproduced defects from a bug hunt (CLI list flags panic, interrupted sync leaves permanent gap, reconcile truncates edits, ...)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 15/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cli, rust, sqlite
- Lĩnh vực
- cli, databases, distributed-systems
Hướng nghiên cứu
This is a grab-bag of 17 independent defects, so pick one item rather than the list. Start by cloning the linked bughunt-2026-11-24-aw-sync-repros branch and running a single test, e.g. cargo test -p aw-sync --test bughunt_edge, then read the cited lines in aw-sync/src/sync.rs or main.rs. Done means that specific repro test goes green without breaking the rest of the aw-sync suite. Item 1 already has a suggested four-line fix at commit 7d09c72, which is the closest thing here to a startable entry point.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A review pass over aw-sync on master ea6f09c found the defects below. Every one has a test that fails on master. The tests are on a branch that is not meant for merging: TimeToBuildBob:bughunt-2026-11-24-aw-sync-repros. Run one file with cargo test -p aw-sync --test bughunt_<file>. The security and edge tests that start a server expect target/debug/aw-server to be built.
Crash (fix ready)
- Every list-valued CLI flag panics. This covers
sync --buckets,sync --host,daemon --bucketsanddedupe --bucket(main.rs:89,112,123,178). The fields areOption<Vec<String>>withvalue_parser=parse_list, which already returns aVec, so clap panics on access withMismatch between definition and access of 'buckets'and the process exits with 101. As a result,--buckets/--hostfiltering can't be used at all, anddedupecan never delete anything, because deleting requires--bucket.- Fix and unit test (red on master, green with the fix):
7d09c72, a 4-line type change to the::std::vec::Vecopt-out. I can open it as a PR if wanted.
- Fix and unit test (red on master, green with the fix):
Data loss / wrong data
- An interrupted multi-page sync leaves a permanent gap.
sync_onewrites the newest page first (sync.rs:1186-1250) and resumes from the destination's newest event (sync.rs:1085). If a pass dies after page 1, every later pass resumes past the hole and reports "up to date". Ways that happens: SIGTERM (ctrlcis built withouttermination), an HTTP timeout, or Android killing the job. A peer can hit the same gap with no failure anywhere, by pulling a staging snapshot taken mid-push. Same root cause as #696, but a new trigger, and it hits push too; #789 only covers pull. Two independent reviewers found this one.- Tests:
bughunt_concurrency.rs::interrupted_multipage_push_leaves_permanent_gap(4999 vs 5003),peer_pull_of_mid_push_snapshot_permanently_misses_older_events, andbughunt_errors.rs::partial_multipage_write_permanently_loses_older_events(4999 vs 12000).
- Tests:
- Editing an event that straddles the 7-day reconcile lookback truncates it permanently.
get_eventsclips the event's start tolookback_start, so thetimestamp >= lookback_startguards (sync.rs:1004,1017) never exclude it. Both sides then match on the clipped identity, the clipped source copy is inserted, and the full destination row is deleted (sync.rs:1055-1059). Example: a 10-day AFK event loses 3 days and 1 hour.- Test:
bughunt_correctness.rs::reconcile_edit_of_event_straddling_lookback_start_truncates_it.
- Test:
- A changed zero-duration latest event is duplicated instead of replaced. When the destination's newest event has duration 0,
resume == its timestamp, so reconcile skips it on both sides (timestamp < resume). The incremental copy inserts the new version next to the stale one. The real trigger is a stopwatch timer that is synced while running and then stopped: the destination keeps a phantomrunning:truerow. This is plausibly where #717's duplicated running rows come from.- Tests:
stopped_stopwatch_leaves_phantom_running_row_on_dest,title_edit_of_zero_duration_latest_event_duplicates_it. Variant:stopped_overlapping_timer_is_truncated_on_dest, where a timer stopped while a second one runs is synced as 15 minutes instead of 25.
- Tests:
- One bucket with
hostname == "unknown"blocks every bucket from that peer on pull. The refusal atsync.rs:874sits insidecollect::<Result<…>>()?, before the per-bucket skip loop. A hostname that only sanitizes to unknown is skipped per bucket, as intended. Two reviewers found this one.- Tests:
bughunt_errors.rs::unknown_hostname_bucket_blocks_all_sibling_buckets_on_pull,bughunt_edge.rs::unknown_hostname_bucket_does_not_block_healthy_sibling_on_pull.
- Tests:
- A non-ASCII hostname is pushed as
"unknown"and then refused by every peer. The device-id substitution atsync.rs:867checks only the literal"unknown", before sanitizing (sync.rs:648,745). A bucket from hostкомпьютерtherefore lands in staging with hostnameunknown.- Test:
bughunt_edge.rs::non_ascii_hostname_survives_push_then_pull.
- Test:
- Two overlapping pull passes import the same events twice. The resume point is read and the events are written later with no lock in between, and aw-sync has no single-instance lock. Example: the daemon with
pull = trueplus a manualaw-sync sync.- Test:
bughunt_concurrency.rs::overlapping_pull_passes_duplicate_events(11 vs 7).
- Test:
- If every peer fails on pull, the device stops pushing its own data.
sync_runin Both mode returns before push (sync.rs:167-172,192-196), and so do plainsync(main.rs:373) and Android full sync (android.rs:350). One corrupt peer db is enough to stop publishing.- Repro: a garbage peer
sync.dbmakessync --mode bothexit 1 and leaves its own staging db at 0 buckets; removing that peer makes it stage normally.
- Repro: a garbage peer
dedupeflags distinct events as duplicates. Pages after the first useend = cut - 1ns, and the server clips each event ending after that bound (dedupe.rs:107). Two events with the same start and data but different durations, both crossing the cut, then compare equal. Deletion is currently blocked only by #1.- Test:
bughunt_edge.rs::dedupe_does_not_flag_distinct_durations_straddling_page_cut.
- Test:
Trust boundary: peers writing into a shared folder
- Push follows a symlink planted at its own staging path and migrates whatever sqlite file it points to.
setup_local_remote/local_staging_db_path(sync.rs:293-311) check withexists()and open read-write.staging.rsandlegacy_clean.rsboth guard against symlinks; this path doesn't. In the test, aplaces.sqlite-like file comes out with aw tables,user_version=6and WAL mode.- Test:
bughunt_security.rs::push_follows_planted_symlink_and_migrates_foreign_sqlite_db.
Not defects under the current trust model: aw-sync treats every participant in the sync folder as trusted, and anyone who can write that folder can already edit a peer'ssync.dbdirectly. These two are noted only because they show how an accident (two devices with the same or colliding hostname) turns into data loss. They belong to the device-identity work (#694, activitywatch#302), not this list:
- Test:
- A peer whose
$aw.sync.origin/hostname matches another device's writes into that device's…-synced-from-bucket (sync.rs:601-622). Edit reconcile can then delete the real rows, and a far-future event freezes the resume point. Tests:peer_spoofing_origin_*. - The "keep largest db per device_id" rule (
util.rs:620-631) lets any folder claiming a device_id shadow that device's real db. Test:foreign_folder_claiming_peer_device_id_shadows_real_peer.
Minor
- A per-bucket sync failure returns
Ok, so the peer is reported asimported,0 failed(sync.rs:908-930,511-514). Test:per_bucket_failure_is_invisible_in_ok_result. Its assertion is stricter than the fix needs: a fix that surfaces the failure as a report warning would still fail it. - Reconcile correctly deletes a pre-existing destination duplicate, but the "event count shrank" check (
sync.rs:1313) then fails the bucket, and for a peer with a single bucket, the whole pass. Test:reconcile_dedup_reports_bucket_failure. - A tie run longer than one page (5000 events at the same timestamp) loses its tail, and later passes add up to 5000 duplicates (
sync.rs:1237-1241). This is mostly a risk for buckets that are already corrupted. Tests:tie_run_larger_than_a_page_*. - A far-future event, for example from a clock that was briefly a year ahead, stops a bucket syncing until the wall clock catches up. This is the #696 family; the trigger is listed for completeness. Test:
future_dated_event_from_clock_skew_stalls_bucket. - Distinct devices whose names sanitize to the same string are merged into one bucket for host-less bucket ids such as
aw-watcher-android-test. For example,Galaxy МашиandGalaxy Петиboth becomegalaxy. Test:distinct_devices_with_colliding_sanitized_names_are_not_merged.
Suspicions that did not reproduce (left out): pull following symlinks (read-only), unvalidated --host path joins (local input only), and Syncthing .sync-conflict copies being picked by the largest-file rule (not tested).
An independent pass tried to refute each finding. It reclassified the two peer-spoofing items above as by-design, and every other item it checked held up.
- Ngôn ngữ chính
- Rust
- Star
- 322
- Fork
- 107
- Merge trung bình
- 2 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 25
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ActivityWatch/aw-server-rust
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
ActivityWatch/aw-server-rust#883 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
ActivityWatch/aw-server-rust#872 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ActivityWatch/aw-server-rust#798 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
query: categorize rules can pin unbounded memory in the regex cache and run past query_timeoutCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
ActivityWatch/aw-server-rust#893 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
aw-client CLI ignores aw-client.toml host/portCó thể đã có người làm @TimeToBuildBob đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
ActivityWatch/aw-server-rust#888 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của ActivityWatch/aw-server-rust
Issue tương tự
-
renaming a provider to a taken name fails with a raw sql errorCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea:storage kind:bug priority:p3 ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
expo/exact#1716 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
XLSX files cannot be imported into Adobe InDesign due to missing AppVersion in extended propertiesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
qingjian-team/qingjian#1181 ·
Maintainer thường phản hồi trong vòng 2 ngày