Skip to content

fix(android): avoid blocking foreground delivery and consume display events - #1976

Open
OskarEichler wants to merge 1 commit into
OneSignal:mainfrom
OskarEichler:codex/onesignal-android-foreground-display
Open

fix(android): avoid blocking foreground delivery and consume display events#1976
OskarEichler wants to merge 1 commit into
OneSignal:mainfrom
OskarEichler:codex/onesignal-android-foreground-display

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Description

One Line Summary

Remove the wrapper wait loop and redundant prevention map. The native SDK already supports preventing display and returning before a later explicit display call. Use a synchronized map and atomically consume displayed events. Return immediately after the no-listener default display.

Compatibility and observable changes

No automatic display timer is added. Explicit suppression stays suppressed, and deferred display remains under application control. Repeated display commands for a consumed event are ignored. Nullable native IDs remain supported. This differs from closed #1887, which proposed timeout-driven automatic display.

Details

Motivation

The source audit reproduced the failure paths described below. This PR contains only the associated fix; unrelated audit changes are in separate PRs.

Scope

  • android/src/main/java/com/onesignal/rnonesignalandroid/RNOneSignal.java

Testing

Compiled real Java method bodies with native/bridge doubles exercise the blocked callback, duplicate display, cache release, no-listener path, deferred display, and nullable-ID controls. Checked against the 5.9.9 native SDK interfaces. No live push service or physical device delivery claim.

Each code/tooling fix was also applied independently to upstream commit a70312207cf094ac361eaa9196c317acb175c2cd and passed its targeted external actual-source diagnostics. Documentation snippets were checked separately. Native diagnostic harnesses use bridge/SDK doubles and are not an end-to-end push test.

On the combined audit branch:

  • Existing SDK suite: 5 files, 262 tests pass; unchanged 95% coverage thresholds pass.
  • vp check: formatting, lint and type checks pass; native Spotless check passes.
  • Both example apps: Android Debug and unsigned iOS Simulator builds pass.
  • Both example apps: iOS and Android production Metro bundles pass.

No checked-in test files were added or modified; regression evidence comes from external diagnostic harnesses and the existing suite. No physical-device, live notification delivery, Appium/BrowserStack, or release-workflow execution is claimed. The no-location example's stale native lock was updated locally to resolve the current SDK for verification; generated locks are not part of this PR.

Checklist

  • Required description sections completed.
  • Scope and observable/API behavior explained.
  • Diff reviewed and targeted regression checks run.
  • Automated checks and device-testing limitations documented.

@OskarEichler
OskarEichler requested a review from a team as a code owner August 27, 2026 23:46
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