fix(telemetry): flush only at shutdown - #5294
Conversation
Remove the impossible startup-recovery path: arming deliberately truncates every pre-consent buffer, so the startup predicate could only race with events queued by the current process and send them before a mid-session opt-out. Make the single shutdown flush structural by removing the non-final actor message and public flush API. Strengthen the process-level contract to prove an armed session sends nothing before shutdown, while preserving the shutdown consent re-check and bounded deadline. Verified with the telemetry unit suite, five focused process-level race runs, the full 263-test integration target, strict workspace all-target/all-feature Clippy, source/runtime/dead-code budgets, formatting, and diff checks.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Claude finished @Hmbown's task in 2m 5s —— View job Review: fix(telemetry): flush only at shutdown
SummaryThis PR removes the "startup drain" flush path ( The rewritten Minor:
|
Summary
Root cause
buffer::arm()deliberately truncates every pre-existing telemetry buffer. The startup predicate therefore could not recover a prior session; it only observedinstall_or_upgradeandsession_startevents freshly queued by the current process. Under CI scheduling, that background task posted them before the test's external opt-out write.This is the exact failure from protected exact-main CI run 31257458192, Ubuntu job 93102972086.
Verification
No-Issue: this is an immediate v0.9.5 privacy/release-gate failure discovered only by the protected exact-main proof after PR #5292 merged.