Repository navigation
fix: treat time since last in-app as unbounded when no in-app was dismissed - #2814
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
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.
Description
One Line Summary
Fix "Time since last in-app message" triggers that wait instead of firing when no in-app message has been dismissed yet.
Details
Motivation
Fixes #1602. When
lastTimeInAppDismissedis null,DynamicTriggerControllerfalls back toDEFAULT_LAST_IN_APP_TIME_AGO, which is meant to mean "a very long time ago". The constant is999999, but the value is compared against intervals in milliseconds, so it only represents about 16.7 minutes.As a result, a trigger such as "time since last in-app message greater than 3600 seconds" does not fire for a user who has never dismissed an in-app message. Instead, the SDK schedules a timer for the remaining 43 minutes or so, and the message shows late or not at all if the session ends first. Any threshold above about 16.7 minutes is affected.
The fallback is now
Long.MAX_VALUE, so a user who has never dismissed an in-app message always satisfies a "greater than" threshold, and never satisfies a "less than" threshold.Scope
Only the fallback used when no in-app message has been dismissed changes. Triggers evaluated after a dismissal still use the persisted dismissal time, and session-time triggers are unchanged.
Testing
Unit testing
Added
DynamicTriggerControllerTests:Manual testing
Not tested on a device. The change only affects the trigger evaluation covered by the unit tests.
Affected code checklist
Checklist
Overview
Testing
Final pass