fix: [SDK-4513] re-display queued in-app messages on unpause#2671
Draft
claude[bot] wants to merge 1 commit into
Draft
fix: [SDK-4513] re-display queued in-app messages on unpause#2671claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
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
Contributor
📊 Diff Coverage ReportDiff 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
Overall (aggregate gate)1/1 touched executable lines covered (100.0% — requires ≥ 80%) |
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.
Requested by Fadi George · Slack thread
Before / After
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).How
While paused,
attemptToShowInAppMessage()early-returns, so messages stay parked inmessageDisplayQueue. On unpause thepausedsetter previously called onlyevaluateInAppMessages()— which re-evaluates triggers but only drains the queue for messages that newly qualify (viaqueueMessageForDisplay()). Messages already sitting in the queue were never re-attempted.The fix adds an
attemptToShowInAppMessage()call to theif (!value)unpause branch of the setter, ahead of the existingevaluateInAppMessages()call, so the existing queue is drained first and then triggers are re-evaluated. Both calls run inside the existingsuspendifyOnDefault { }block.File:
OneSignalSDK/onesignal/in-app-messages/src/main/java/com/onesignal/inAppMessages/internal/InAppMessagesManager.ktLinked issues
Generated by Claude Code