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

aw-server: re-importing an export duplicates events when a redact privacy rule is active

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

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend, database

Direzione di ricerca

Trace the import endpoint through create_bucket and insert_events into the datastore and privacy engine, starting at the dedup/filter boundary. Reproduce the redact case described in the issue for both import paths. Done means re-importing the same export keeps one event, while filtering is applied exactly once and drop rules still behave correctly.

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

Descrizione

Problem

When a redact privacy rule is active, re-importing the same export is not idempotent — each import can append a duplicate event instead of matching the stored one.

Why

The datastore stores the filtered event (redacted data) under a new local id. The import endpoint's deduplication compares the incoming event's identity (timestamp, duration, raw data) against the stored events. For a redacted event the stored data never matches the raw source data, so the event is inserted again on every re-import, inflating counts.

This affects both import paths — a new bucket (events attached to create_bucket) and an existing bucket (insert_events) — because both run the privacy engine before storing.

Reproduction

  1. Set privacy_filters to a redact rule on title.
  2. Import an export containing a matching event into a new bucket.
  3. Re-import the same export.
  4. The bucket holds 2 events instead of 1.

Fix direction

Dedup has to identity-match the filtered form of the incoming event against the stored one. A prefilter in the endpoint (apply the rules before dedup, then let the datastore apply them again) is not correct: applying the rules twice is not equivalent to once when a drop rule can match a value an earlier redact rule produced. The fix belongs at the dedup/filter boundary so filtering happens exactly once — e.g. compute the filtered identity inside the datastore.

Found while reviewing #766 (the redact-re-import case, raised by Greptile on that PR).

Lingua principale
Rust
Stelle
317
Fork
99
Merge medio
1g 13h
PR unite (30g)
66

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.