Experiment events are lost when a visitor leaves within flushInterval (no flush on pagehide)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, playwright, react, typescript, vite
- Lĩnh vực
- analytics, backend-api-design
Hướng nghiên cứu
Start by locating the event processor and its flush interval behavior; the issue does not name source files or tests. Reproduce the reported short-visit case in the Playwright browser setup, then inspect how page lifecycle events and event delivery are handled. Done means exposures and conversions are delivered when a visitor leaves before the interval, with regression coverage for that case.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version: @flagsmith/flagsmith 12.6.0 (latest), browser, Experimentation with enableEvents: true.
What happens: the event processor buffers exposures and trackEvent calls and sends them every flushInterval (default 1e4, 10 seconds). Nothing flushes the buffer when the page is hidden or closed: there is no pagehide / visibilitychange handler, and the request doesn't use keepalive or navigator.sendBeacon. A visitor who leaves within 10 seconds never reaches the experiment, and neither does a conversion made just before leaving.
How we saw it: we ran 40 scripted browser visits (Playwright, real Chromium) through an experiment on a React + Vite app wired with FlagsmithProvider, getExperimentFlag and trackEvent. Each visit lasted 3–6 seconds.
| Visits | Exposures recorded |
|---|---|
3–6 s, default flushInterval |
0 of 40 |
11 s, default flushInterval |
40 of 40 |
3–6 s, eventProcessorConfig: { flushInterval: 1000 } |
40 of 40 |
Same app, same build, same Flagsmith instance; only the visit length or the interval changed. The app also called flagsmith.flushEvents() from a pagehide listener; with visits that end by closing the page, that didn't deliver the events either.
Why it matters for experiments: if one variant makes people leave sooner, that arm loses more exposures and conversions than the other, so the result is biased, and the sample ratio may still look fine.
Suggestion: flush on pagehide (and visibilitychange to hidden) with fetch(url, { keepalive: true, ... }) or navigator.sendBeacon, and consider a shorter default interval for experiment exposures. Until then, a line about flushInterval in the Experimentation docs and the coding-agent set-up prompt would save people from this.
- Ngôn ngữ chính
- TypeScript
- Star
- 67
- Fork
- 47
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không 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 Flagsmith/flagsmith-js-client
-
`init({ traits })` double-wraps `{ value, transient }` trait objects, sending a nested `trait_value`Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Flagsmith/flagsmith-js-client#444 ·
-
Dependency DashboardĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 20/100
Flagsmith/flagsmith-js-client#435 ·
-
Move module-scope Emitter in react.tsx into the ProviderCó thể đã có người làm @EngineerOnTravel đã nhận 101 ngày trước. Đang mởbug good first issue
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
Flagsmith/flagsmith-js-client#391 · 1 bình luận ·
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
Flagsmith/flagsmith-js-client#371 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Flagsmith/flagsmith-js-client#330 ·
Tất cả issue của Flagsmith/flagsmith-js-client
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
knaw-huc/textannoviz#742 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
cloudflare/realtimekit-ui#219 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ui
Độ 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
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaksCó thể đã có người làm @argszero đã nhận hôm nay. Đang mởarea/tui platform/wsl status/repro-simulated type/bug version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
anomalyco/opencode#66773 · 2 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 82/100
mermaid-js/mermaid-v13#1370 ·
Maintainer thường phản hồi trong vòng 1 ngày