Tracking: a retried event is stored twice, so revenue and count metrics double-count it
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
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 4
- Merge trung bình
- 6 giờ 5 phút
- Pull request đã merge (30 ngày)
- 453
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 Controlvar/controlvar
-
Dashboard: an archived flag shows Off with an on/off switch the API refusesCó thể đã có người làm @amarkanday đã nhận 1 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Controlvar/controlvar#1748 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dashboard: the sequential panel's "Ready to stop" banner shows no sample-ratio-mismatch cautionCó thể đã có người làm @amarkanday đã nhận 1 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Controlvar/controlvar#1737 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
dashboard: a split URL draft's variant edit shows generic copy when the API refuses itCó thể đã có người làm @amarkanday đã nhận 1 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Controlvar/controlvar#1562 · 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 90/100
Controlvar/controlvar#1447 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Experiment setup: emptying a traffic share box and typing a number shows a leading zero ("034")Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Controlvar/controlvar#1428 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Controlvar/controlvar
Issue tương tự
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
graphql-python/graphql-core#304 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs size:S
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Gathin23/cleanyourtv#3464 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày