Tracking: a retried event is stored twice, so revenue and count metrics double-count it
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 15/100
Línea de trabajo
Start with the event request schema in backend/app/schemas/tracking.py (around line 392), the events table in backend/app/models/event.py (lines 126-138), and the metric queries in AnalysisService.value_totals and event_counts in backend/app/services/analysis_service.py. The approach is not decided yet, so first get a maintainer decision on the event-id design. Done would mean a regression test that posts the same purchase twice to /track and shows revenue per user counts it once.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
POST /api/v1/tracking/track and POST /api/v1/tracking/batch store every event they receive, and nothing identifies an event across requests:
EventRequest(backend/app/schemas/tracking.py:392) has no event-id field;events.idis generated by the server;- the
eventstable has plain indexes only, with no unique constraint (backend/app/models/event.py:126-138).
So a client that retries after a timeout stores the event twice whenever the first request was in fact stored.
What it changes in results
- Revenue metrics sum
Event.valueper user (AnalysisService.value_totals,backend/app/services/analysis_service.py:311), so a retried purchase counts twice. - Count metrics count every stored event (
AnalysisService.event_counts,analysis_service.py:276), so they double too. - Conversion rates are unaffected, because they count distinct users.
- Assignments are unaffected, because
/assignis idempotent through the unique(experiment_id, user_id)index.
The error isn't the same in both arms. The arm whose clients retry more, for example a slower variant, gets more duplicates, which biases the comparison and doesn't just add noise.
Evidence
Read in the code at main d48e06c. It has not been reproduced by a run yet. The fix's regression test should do that: send the same purchase twice through /track, and check that revenue per user counts it once.
Direction (to be planned, not decided)
The usual pattern is an optional event id supplied by the client, deduplicated per user, in the manner of an idempotency key. That needs a migration, an API contract change and SDK changes, so it goes through the full process. It is also the first fault scenario for the ground-truth replay tests in #1544.
- Lenguaje dominante
- Python
- Estrellas
- 0
- Forks
- 4
- Merge medio
- 5 h 36 min
- PR fusionados (30 d)
- 509
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Controlvar/controlvar
-
bug post-launch
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Controlvar/controlvar#1748 ·
Los mantenedores suelen responder en 1 día
-
Dashboard: the sequential panel's "Ready to stop" banner shows no sample-ratio-mismatch cautionAbiertobug post-launch
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Controlvar/controlvar#1737 ·
Los mantenedores suelen responder en 1 día
-
bug post-launch
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Controlvar/controlvar#1562 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
Controlvar/controlvar#1447 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Experiment setup: emptying a traffic share box and typing a number shows a leading zero ("034")Abiertobug post-launch
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Controlvar/controlvar#1428 ·
Los mantenedores suelen responder en 1 día
Todos los issues de Controlvar/controlvar
Issues similares
-
fuzz fuzz-unconfirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
neilsh/stunt-reel#220 ·
Los mantenedores suelen responder en 1 día
-
[Issue]: use_fp4_cache is accepted but ignored; the launcher always writes FP8 recordsPosiblemente ocupada @0z5a la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
area: cli priority: p3 size: S type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
finos/open-resource-broker#757 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 6 días