Add global.is_first_daily_occurrence to wide events - #9422
Merged
lmac012 merged 5 commits intoAug 12, 2026
Merged
Conversation
lmac012
force-pushed
the
feature/lukasz/wide-event-first-daily-occurrence
branch
from
August 10, 2026 07:41
88505d6 to
d2fc784
Compare
Adds the `is_first_daily_occurrence` column to `wide_events` and a table tracking the last day each (event name, status) pair was recorded. Nothing writes to them yet. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The flag is computed at completion time, inside the transaction that sets the status, so both transports report the same value and a delayed or retried send keeps the value from the day the event completed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both transports report the flag: as a typed boolean in the POST body, and as a parameter on both the count and daily pixels. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds the shared dictionary entry and references it from every wide event definition. The post-idle-session definition declared the parameter inline, never having been sent by the app; it now uses the dictionary entry. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
lmac012
force-pushed
the
feature/lukasz/wide-event-first-daily-occurrence
branch
from
August 11, 2026 10:05
d2fc784 to
fd7675e
Compare
lmac012
marked this pull request as ready for review
August 11, 2026 11:08
joshliebe
approved these changes
Aug 11, 2026
joshliebe
left a comment
Contributor
There was a problem hiding this comment.
Tested, works as described. LGTM! 🚀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task/Issue URL: https://app.asana.com/1/137249556945/project/1205648422731273/task/1217255814219409?focus=true
Tech Design URL (if applicable):
API Proposals URL(s) (if applicable): None
Description
Adds
global.is_first_daily_occurrenceto every wide event:truewhen it is the first event completed with the same feature name and status in the current UTC calendar day.The flag is computed at completion time, inside the transaction that sets the event status, so both transports report the same value and a delayed or retried send keeps the value from the day the event completed. A new
wide_event_daily_occurrencestable holds one row per name/status pair, overwritten daily.No public API or call-site changes — it is handled entirely inside
statistics-impl.Steps to test this PR
First daily occurrence flag
DataClearingWideEvent.kt, temporarily changeSAMPLING_PROBABILITYfrom0.05fto1.0fso every burn is recorded (revert before merging)is_first_daily_occurrence=1is_first_daily_occurrence=1improving.duckduckgo.com/e-is_first_daily_occurrenceflag should be presentNo UI changes
Note
Medium Risk
Touches wide-event persistence (migration + new table) and outbound analytics payloads, but changes are isolated to statistics-impl with no public API surface.
Overview
Adds
global.is_first_daily_occurrenceto completed wide events so analytics can tell whether an event is the first completion that UTC day for the same feature name and status.The flag is set inside
setWideEventStatus(same DB transaction as status), using a dedup keyname:statusand a newwide_event_daily_occurrencestable;wide_eventsgainsis_first_daily_occurrencevia Room v5 migration. Both the API payload and pixel parameters include the field; pixel schemas adopt the sharedwidePixelIsFirstDailyOccurrenceparam (replacing the inline definition on post-idle session).Reviewed by Cursor Bugbot for commit e6efda1. Bugbot is set up for automated code reviews on this repo. Configure here.