Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

aw-sync: rowid cursor misses heartbeat extensions to trailing open event

Aperta
#790 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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:

  1. Event A (rowid 100, T1–T2) is synced → cursor saved at 100
  2. A heartbeat extends event A's endtime to T2+30 (rowid still 100)
  3. Next sync: get_events_since_rowid(100) returns only rowid > 100 → misses the T2→T2+30 extension
  4. reconcile_updated_events handles the lookback window up to resume_sync_at but 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
Lingua principale
Rust
Stelle
317
Fork
100
Merge medio
3g 6h
PR unite (30g)
77

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ActivityWatch/aw-server-rust

Tutte le issue di ActivityWatch/aw-server-rust

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.