Repository navigation
fix(events): give each environment the whole byte capacity - #431
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
…hare of it Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Automated risk review (dry run): Medium
This PR would not be automatically approved. Human approval required.
Why: ComponentsImpl now gives every environment the full capacityBytes instead of a shared split, which changes persisted-event disk usage for multi-environment apps. The unit test covers the new per-environment quota, but that behavior change is above the Low auto-approval threshold. Human review is needed; no reviewers were assigned.
Sent by Cursor Approval Agent: Dry-Run PR Approver
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.


Each environment now has the whole
capacityBytes, likecapacity, rather than an equal share of it. This follows the review on iOS (ios-client-sdk#538), which makes the same change.Stacked on #408 (tier 3).
capacity(2000 events) long before that; only unusually large events, or summaries piling up through a long outage, get near it.ComponentsImpl.shareOfCapacityBytesis gone; the store getscapacityBytesas it is, and already reads zero or less as the default. TheEventProcessorBuilder.capacityBytesdocs say it is for each environment.Test:
theByteCapacityIsSharedEquallyByTheConfiguredEnvironmentsbecomeseachEnvironmentHasTheWholeByteCapacityHoweverManyAreConfigured: with seven environments and a 2,400-byte capacity, an 850-byte event is delivered, where the old split's 342 bytes would have refused it../gradlew :launchdarkly-android-client-sdk:testDebugUnitTest: 1257 tests, 0 failures (25 skipped).Note
Overview
Persisted event byte limits are now per environment, matching
capacity(int)and the iOS client change, instead of splittingcapacityBytesevenly across all configured mobile keys.ComponentsImpldropsshareOfCapacityBytesand passes the configuredcapacityBytesstraight intoEventStore.create.EventProcessorBuilderdocs are updated to state each secondary environment gets the full limit, so adding environments no longer shrinks others and apps with many envs (e.g. seven) aren’t stuck with tiny per-env quotas.The unit test is renamed and asserts that with seven environments and a 2,400-byte limit, an ~850-byte custom event still flushes—behavior that would fail under the old equal-share rule.
Reviewed by Cursor Bugbot for commit a809095. Bugbot is set up for automated code reviews on this repo. Configure here.