Skip to content

fix: [SDK-4513] re-display queued in-app messages on unpause#2671

Draft
claude[bot] wants to merge 1 commit into
mainfrom
fix/sdk-4513-iam-unpause-redisplay
Draft

fix: [SDK-4513] re-display queued in-app messages on unpause#2671
claude[bot] wants to merge 1 commit into
mainfrom
fix/sdk-4513-iam-unpause-redisplay

Conversation

@claude

@claude claude Bot commented Jun 25, 2026

Copy link
Copy Markdown

Requested by Fadi George · Slack thread

Before / After

  • Before: Turning off pause (InAppMessages.Paused = false) left in-app messages that had been queued while paused stuck in the display queue. They would not show until the next session boundary (app backgrounded 30+ seconds, then foregrounded).
  • After: Those already-queued messages display immediately on unpause, as the documentation implies ("Changing the value to false resumes normal message delivery for users who qualify based on their triggers").

How

While paused, attemptToShowInAppMessage() early-returns, so messages stay parked in messageDisplayQueue. On unpause the paused setter previously called only evaluateInAppMessages() — which re-evaluates triggers but only drains the queue for messages that newly qualify (via queueMessageForDisplay()). Messages already sitting in the queue were never re-attempted.

The fix adds an attemptToShowInAppMessage() call to the if (!value) unpause branch of the setter, ahead of the existing evaluateInAppMessages() call, so the existing queue is drained first and then triggers are re-evaluated. Both calls run inside the existing suspendifyOnDefault { } block.

File: OneSignalSDK/onesignal/in-app-messages/src/main/java/com/onesignal/inAppMessages/internal/InAppMessagesManager.kt

Linked issues


Generated by Claude Code

Setting InAppMessages.Paused = false re-evaluated triggers but never
drained messages already queued while paused, so they stayed parked in
messageDisplayQueue until the next session boundary. The unpause branch
of the paused setter now also calls attemptToShowInAppMessage() to drain
the existing queue before re-evaluating triggers.

Fixes #2647
@claude claude Bot changed the title Re-attempt display of queued IAMs when unpausing in-app messages fix: [SDK-4513] re-display queued in-app messages on unpause Jun 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📊 Diff Coverage Report

Diff Coverage Report (Changed Lines Only)

Gate: aggregate coverage on changed executable lines must be ≥ 80% (JaCoCo line data for lines touched in the diff).

Changed Files Coverage

  • InAppMessagesManager.kt: 1/1 touched executable lines (100.0%) (3 touched lines in diff)

Overall (aggregate gate)

1/1 touched executable lines covered (100.0% — requires ≥ 80%)

📥 View workflow run

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.

[Bug]: InAppMessages.Paused = false does not re-attempt display of queued IAMs mid-session

1 participant