aw-sync: rowid cursor misses heartbeat extensions to trailing open event
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
Research direction
Start by reading the rowid fast-path around get_events_since_rowid and how reconcile_updated_events uses resume_sync_at. Then trace where the highest-rowid trailing event can be re-synced; done means heartbeat extensions to that event are included in the destination without losing the rowid cursor's handling of late-arriving events.
Written by the indexing model from the issue text.
Description
Problem
The rowid-cursor sync introduced in #789 doesn't re-fetch events whose endtime was extended by a heartbeat after the event's rowid was synced.
Scenario:
- Event A (rowid 100, T1–T2) is synced → cursor saved at 100
- A heartbeat extends event A's
endtimeto T2+30 (rowid still 100) - Next sync:
get_events_since_rowid(100)returns only rowid > 100 → misses the T2→T2+30 extension reconcile_updated_eventshandles the lookback window up toresume_sync_atbut not extensions beyond that boundary
Impact
Bounded: only the trailing open event at sync time loses the heartbeat extension in the destination. The impact resolves on the next natural event transition (when a new event starts and the old one closes).
Tradeoff
This is a known tradeoff vs. the old timestamp-scan path:
- Rowid cursor: correct for late-arriving events (the core #696 fix), but misses
endtime-only updates - Timestamp scan: re-fetches events in the time window, catching heartbeat extensions, but permanently loses late-arriving events (#696)
Proposed fix
After the rowid fast-path, re-sync the highest-rowid event from source (the "trailing event") to capture any heartbeat extension since the previous cursor save. This is a small fixed-cost read per bucket per sync pass.
Related
- Fixes #696 (rowid cursor) — #789
- Greptile P1 finding "Continued activity stops growing" on #789
- Dominant language
- Rust
- Stars
- 322
- Forks
- 105
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 22
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ActivityWatch/aw-server-rust
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ActivityWatch/aw-server-rust#798 · 1 comment ·
Maintainers usually reply within 1 day
-
Allow configuring sync dir in the `aw-sync/config.toml` filePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 58/100
ActivityWatch/aw-server-rust#853 · 1 comment ·
Maintainers usually reply within 1 day
-
Correctness bugs: heartbeat cache, query cache invalidation, commit rollback statePossibly taken A pull request linked to this issue is open or already merged. Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 25/100
ActivityWatch/aw-server-rust#825 · 2 comments ·
Maintainers usually reply within 1 day
-
aw-sync: rowid upgrade bootstrap does not recover backfills lost under the old timestamp cursorOpen
Difficulty 5/5 Over a week Newbie friendliness 25/100
ActivityWatch/aw-server-rust#793 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
ActivityWatch/aw-server-rust#717 · 2 comments ·
Maintainers usually reply within 1 day
All issues in ActivityWatch/aw-server-rust
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
symposium-dev/symposium#530 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
topgrade-rs/topgrade#2540 ·
Maintainers usually reply within 1 day
-
Invalid JSON options for ngram and edge_ngram silently use defaultsPossibly taken @Tilendlesa claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
noemaforge/vimanam#153 ·
Maintainers usually reply within 1 day