Repository navigation
feat(events): configurable eventDeliveryDelayMillis for the launch gate - #421
Open
abelonogov-ld wants to merge 1 commit into
Open
abelonogov-ld wants to merge 1 commit into
abelonogov-ld wants to merge 1 commit 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>
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
EventProcessorBuilder.eventDeliveryDelayMillis(long)(experimental, default 2s, clamped 0–60s) so apps can control how long the SDK holds back self-started traffic after first going online, mirroring iOSLDConfig.eventDeliveryDelay.DirectEventProcessorno longer hard-codes a 2s launch delay: pacing uses the configured delay viaPacing.specified(launchDelayMillis), and the launch gate opens immediately only when the delay is 0—not when event persistence is off. Until the gate opens, the diagnostic init event, periodic flush, and (when persisting) backlog from a prior run stay off the network;flush()is never delayed. Batch gap pacing between stored batches remains persistence-only.Notable default behavior change: with persistence disabled, the diagnostic init event now waits 2s after going online instead of sending at once;
eventDeliveryDelayMillis(0)restores immediate delivery.Tests add
EventProcessorBuilderTestfor defaults/clamping and extendDirectEventProcessorTestfor gate timing with and without persistence.Reviewed by Cursor Bugbot for commit 614b75d. Bugbot is set up for automated code reviews on this repo. Configure here.