Repository navigation
feat(events): configurable eventDeliveryDelayMillis for the launch gate - #421
Open
abelonogov-ld wants to merge 2 commits into
Open
abelonogov-ld wants to merge 2 commits into
abelonogov-ld wants to merge 2 commits into
Conversation
Replaces the hard-coded 2 second launch delay with EventProcessorBuilder.eventDeliveryDelayMillis (default 2s, kept between 0 and 60s, experimental). The gate now applies with persistence off too, so the diagnostic init event no longer competes with the first flag request; a delay of 0 opens it at once. Pacing between batches stays persistence-only. Co-authored-by: Cursor <cursoragent@cursor.com>
…istence too The diagnostic init event was the only thing checked to wait for the gate where nothing persists; this run's own events are held the same way. Co-authored-by: Cursor <cursoragent@cursor.com>
This branch has not been deployed
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.
Requirements
Related issues
Stacked on #408 (tier 3, event persistence). This is the Android counterpart of iOS
LDConfig.eventDeliveryDelay, and it closes the review gap that the start delay couldn't be configured.Describe the solution you've provided
Adds
EventProcessorBuilder.eventDeliveryDelayMillis(long). It is experimental, defaults to 2,000 ms, and is kept between 0 and 60,000 ms. It replaces the hard-coded 2 s launch delay.flush()is never held.DirectEventProcessornow opens the gate from the start only when the delay is 0, rather than whenever persistence is off. Recovery of a previous run's events already delivers in either order, whether it finishes before or after the gate opens.Tests
EventProcessorBuilderTest(new) covers the default and the clamping.DirectEventProcessorTest:testDebugUnitTestrun passes: 1,263 tests, 25 skipped, 0 failures, including the run without persistence.Describe alternatives you've considered
Additional context
Behavior change: with persistence off, the diagnostic init event now goes out 2 s after going online by default, rather than at once. Apps that want the old timing can set
eventDeliveryDelayMillis(0).Note
Overview
Adds an experimental
EventProcessorBuilder.eventDeliveryDelayMillis(long)(default 2s, clamped 0–60s) so apps can control how long the SDK holds back self-started traffic after going online, instead of a hard-coded launch delay wired throughDirectEventProcessor.Pacing.specified(...).Launch gate behavior changes: the gate now depends on that delay (open immediately when delay is 0), not on whether event persistence is enabled. With persistence off, the diagnostic init event and periodic delivery wait by default like persisted setups;
flush()is still never delayed. Gap pacing between batches remains persistence-only.New
EventProcessorBuilderTestand expandedDirectEventProcessorTestcover defaults, clamping, gate timing with/without persistence, and zero-delay immediate delivery.Reviewed by Cursor Bugbot for commit 4e6efc5. Bugbot is set up for automated code reviews on this repo. Configure here.