feat(events): make event serialization usable from another package - #214
Merged
abelonogov-ld merged 1 commit intoSep 15, 2026
Merged
Conversation
abelonogov-ld
added a commit
to launchdarkly/android-client-sdk
that referenced
this pull request
Sep 15, 2026
The next commit drops the split-package hack in favor of declarations that launchdarkly/java-core#214 makes public. That is not in a release yet, so this points the build at a working copy until one carries it. Skipped when the directory is absent, so a clean checkout still resolves the published artifact rather than failing. Revert together with a version bump once the release is out. Co-authored-by: Cursor <cursoragent@cursor.com>
abelonogov-ld
added a commit
to launchdarkly/android-client-sdk
that referenced
this pull request
Sep 15, 2026
…package AndroidEventBuffer was declared in com.launchdarkly.sdk.internal.events so it could reach the summarizers and the output formatter, which were package-private there. That made a package split across two artifacts, forced the class to be public for the rest of the SDK to use it, and needed a javadoc exclusion plus a classpath workaround to keep it out of the published docs. launchdarkly/java-core#214 makes those declarations public, so the class moves to com.launchdarkly.sdk.android where it belongs. It is package-private now, along with its members and Payload, because everything using it is in that package, so it is out of the published docs by virtue of its visibility rather than by being excluded from javadoc. The build.gradle javadoc block goes back to what it was before tier 1. No behavior change: same summarization, same wire format, same tests. Co-authored-by: Cursor <cursoragent@cursor.com>
The Android SDK's event durability work summarizes and serializes events on the recording thread, in front of the bounded queue DefaultEventProcessor keeps. It therefore needs the summarizers and the output formatter directly, and there is no public way to hand java-sdk-internal a summary that has already been aggregated. Today the Android SDK reaches them by declaring a class in this package, which is a split package across two artifacts. Widening these five declarations lets it use its own package instead and keeps one implementation of the wire format rather than a second copy that could drift. Visibility only. No behavior changes, and every member that was package-private stays that way except the two constructors and the one method the caller needs: EventOutputFormatter class, constructor, writeOutputEvents EventSummarizerInterface interface AggregatedEventSummarizer class, constructor PerContextEventSummarizer class, constructor EventSummarizer class only, so EventSummary can be named EventSummarizer.EventSummary class only; an opaque token to a caller Co-authored-by: Cursor <cursoragent@cursor.com>
abelonogov-ld
force-pushed
the
andrey/expose-event-serialization-for-android
branch
from
September 15, 2026 16:30
d409fc7 to
ab9990a
Compare
tanderson-ld
approved these changes
Sep 15, 2026
abelonogov-ld
deleted the
andrey/expose-event-serialization-for-android
branch
September 15, 2026 16:37
abelonogov-ld
pushed a commit
that referenced
this pull request
Sep 15, 2026
🤖 I have created a release *beep* *boop* --- ## [1.12.0](launchdarkly-java-sdk-internal-1.11.1...launchdarkly-java-sdk-internal-1.12.0) (2026-09-15) ### Features * **events:** make event serialization usable from another package ([#214](#214)) ([185dfbb](185dfbb)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > **Release Please** cut for **`launchdarkly-java-sdk-internal` 1.12.0** — no library source in this diff. > > The PR updates the release manifest and `gradle.properties` from **1.11.1 → 1.12.0** and adds the **1.12.0** section to `CHANGELOG.md`. That release is documented as exposing **event serialization for use from other packages** ([#214](#214)); the implementation landed in an earlier commit, not in these files. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit cc8ac8f. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
What
Widens five declarations in
com.launchdarkly.sdk.internal.eventsfrom package-private to public. Visibility only — no behavior change.EventOutputFormatterwriteOutputEventsEventSummarizerInterfaceAggregatedEventSummarizerPerContextEventSummarizerEventSummarizerEventSummarycan be namedEventSummarizer.EventSummaryEverything else stays package-private.
EventSummarizerandEventSummarygain no callable surface:EventSummarizer's constructors and methods are untouched, andEventSummarycannot be constructed from outside the package. They are public so the typeList<EventSummarizer.EventSummary>can be named by a caller passing it from a summarizer to the formatter.Why
The Android SDK's event durability work summarizes and serializes each event on the thread that recorded it, ahead of the bounded queue that
DefaultEventProcessorkeeps between the caller and the summarizer. That means it needs the summarizers and the output formatter directly:DefaultEventProcessoronly accepts individual events and summarizes them itself, so there is no public way to hand java-sdk-internal a summary that has already been aggregated.Today the Android SDK gets at them by declaring
AndroidEventBufferin this package — a split package across two artifacts, with a javadoc workaround to keep it out of the published docs. That works, but it is not something to keep: it is fragile under any build that takes package ownership seriously, and it puts a class the Android team maintains inside a package this repo owns.With these declarations public, that class moves into
com.launchdarkly.sdk.androidwhere it belongs, and the split package and its build workaround go away. The important part is that the Android SDK keeps using this implementation of the wire format rather than growing a second copy that could drift from it.Notes for review
EventSummary, whichJavadocTyperequires because it is a newly public type. No existing comment was edited.javadocreports three newno commentwarnings, on the two constructors andwriteOutputEvents. That is the same warning roughly eighty existing members in this module already produce, and it does not fail the build.Event,EventsConfigurationandSamplerwere already public and needed no change.compileJava,checkstyleMain,javadocand thecom.launchdarkly.sdk.internal.events.*tests all pass.🤖 Generated with Cursor