Skip to content

test(android): ignore empty events in group message stream - #4001

Open
Mabolla wants to merge 1 commit into
xmtp:mainfrom
Mabolla:fix/android-group-stream-flake
Open

Mabolla wants to merge 1 commit into
xmtp:mainfrom
Mabolla:fix/android-group-stream-flake

Conversation

@Mabolla

@Mabolla Mabolla commented Aug 14, 2026

Copy link
Copy Markdown

Summary

Fixes a flaky Android group message stream test by ignoring empty-body events before asserting on streamed text messages.

The stream can emit non-text/system events with an empty body, so assuming the first emitted item is the "hi" text message can cause the assertion to fail nondeterministically.

This keeps the change scoped to the test and avoids adding timing-based sleeps.

Testing

  • git diff --check passes.
  • Local Android instrumentation testing was not available because no Android SDK/device is configured in the local environment.
  • The Android Gradle project configuration was verified successfully with JDK 17 / Gradle 8.11.1.

Related to #3941.

Note

Filter empty events from group message stream in Android tests

Applies a filter { it.body.isNotEmpty() } to the group.streamMessages() flow in GroupTest.kt so test assertions only operate on non-empty messages. This prevents spurious failures caused by empty events emitted before the actual message arrives.

Macroscope summarized 3246147.

@Mabolla
Mabolla requested a review from a team as a code owner August 14, 2026 22:07

This branch has not been deployed

No deployments
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.

1 participant