Skip to content

feat(events): make event serialization usable from another package - #214

Merged
abelonogov-ld merged 1 commit into
mainfrom
andrey/expose-event-serialization-for-android
Sep 15, 2026
Merged

abelonogov-ld merged 1 commit into
mainfrom
andrey/expose-event-serialization-for-android

Conversation

@abelonogov-ld

@abelonogov-ld abelonogov-ld commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

What

Widens five declarations in com.launchdarkly.sdk.internal.events from package-private to public. Visibility only — no behavior change.

Declaration What becomes public
EventOutputFormatter class, constructor, writeOutputEvents
EventSummarizerInterface interface
AggregatedEventSummarizer class, constructor
PerContextEventSummarizer class, constructor
EventSummarizer class only — so that EventSummary can be named
EventSummarizer.EventSummary class only

Everything else stays package-private. EventSummarizer and EventSummary gain no callable surface: EventSummarizer's constructors and methods are untouched, and EventSummary cannot be constructed from outside the package. They are public so the type List<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 DefaultEventProcessor keeps between the caller and the summarizer. That means it needs the summarizers and the output formatter directly: DefaultEventProcessor only 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 AndroidEventBuffer in 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.android where 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

  • The diff is modifiers only, apart from one added line of javadoc on EventSummary, which JavadocType requires because it is a newly public type. No existing comment was edited.
  • javadoc reports three new no comment warnings, on the two constructors and writeOutputEvents. That is the same warning roughly eighty existing members in this module already produce, and it does not fail the build.
  • Event, EventsConfiguration and Sampler were already public and needed no change.
  • compileJava, checkstyleMain, javadoc and the com.launchdarkly.sdk.internal.events.* tests all pass.

🤖 Generated with Cursor

@abelonogov-ld
abelonogov-ld requested a review from a team as a code owner September 15, 2026 16:02
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
abelonogov-ld force-pushed the andrey/expose-event-serialization-for-android branch from d409fc7 to ab9990a Compare September 15, 2026 16:30
@abelonogov-ld
abelonogov-ld merged commit 185dfbb into main Sep 15, 2026
25 checks passed
@abelonogov-ld
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants