-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: instantly dismiss modal instead of async animation dismissal #739
chore: instantly dismiss modal instead of async animation dismissal #739
Conversation
Part of: https://linear.app/customerio/issue/MBL-355/ios-fix-in-app-message-displayed-on-wrong-page There is a scenario where a modal message can be displayed on the wrong screen due to a timing issue. Although the time window where this could happen is small, it was encountered during QA testing. Test case to reproduce: * In-app message with page rule "Dashboard" sent to device. User on "Dashboard" screen. In-app message begins to render. * Similar to what is explained [here](https://customerio.slack.com/archives/C06H7MMLH6C/p1716391939537599), if the user of the app clicks a button to begin navigating to another screen in the app and the modal message finishes rendering during the screen transition animation, the modal will be displayed and will remain displayed after the animation is complete and the next screen is shown. Solution: Dismiss the modal when the screen transition animation ends and a new page rule is triggered. Ensure that when a Modal message is shown, it does not trigger an automatic screenview event. This allows the SDK to recognize user navigation to a new screen accurately. Testing: * Automated tests added to verify auto screenview tracking. * QA test verified that when a Gist Modal message shown, an automatic screenview event not tracked.
Part of: https://linear.app/customerio/issue/MBL-355/ios-fix-in-app-message-displayed-on-wrong-page When the page route changes in the SDK, we need to have the current modal dismissed and ready to display a new message. Currently, the code dismisses the modal with an animation, so it's an async operation. To reduce edge cases in the code, modify the dismissing of messages to be a synchronous/instant operation. Testing: * In sample app, I manually triggered the cancel/dismiss code to confirm that the modal dismisses instantly and when I change screens, I expect that a new message is able to show. Note to reviewers * This is the behavior implemented in the Android SDK.
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.
|
SDK binary size reports 📊SDK binary size of this PR
SDK binary size diff report between this PR and the main branch
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall nothing stood out except the logic to dismiss the in-app on page rule change.
Are there scenarios where a page rule can match more than one page?
If the answer is yes, then please don't merge till we discuss it.
Edit: For reference, Levi addressed the above question in #740
…/customerio-ios into levi/instantly-dismiss-modals
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## levi/inapp-strict-pagerules #739 +/- ##
==============================================================
Coverage ? 60.81%
==============================================================
Files ? 140
Lines ? 3958
Branches ? 0
==============================================================
Hits ? 2407
Misses ? 1551
Partials ? 0 ☔ View full report in Codecov by Sentry. |
Part of: https://linear.app/customerio/issue/MBL-355/ios-fix-in-app-message-displayed-on-wrong-page
When the page route changes in the SDK, we need to have the current modal dismissed and ready to display a new message. Currently, the code dismisses the modal with an animation, so it's an async operation. To reduce edge cases in the code, modify the dismissing of messages to be a synchronous/instant operation.
Testing:
Note to reviewers
Based on PR #732
Full chain of PRs as of 2024-06-13
levi/instantly-dismiss-modals
➔levi/ignore-cio-autoscreenviews
levi/ignore-cio-autoscreenviews
➔levi/inapp-strict-pagerules
levi/inapp-strict-pagerules
➔main