OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native iOS app with OneSignal. https://onesignal.com
Other
496
stars
263
forks
source link
Cleanup IAM window on the main thread when failing to load #1447
Fix crash that can occur in some cases when we fail to load an IAM
Details
If multiple IAMs have the same trigger then we will have an IAM window that needs to be cleaned up when one of them fails to load. This fix was introduced in this pr, but the failure is not guaranteed to return on the UI thread so it would crash in some cases.
Motivation
Fix crash
Scope
IAM
Testing
Unit testing
none
Manual testing
Manually reproduced with break points and pausing active IAMs as they were about to load
Affected code checklist
[ ] Notifications
[ ] Display
[ ] Open
[ ] Push Processing
[ ] Confirm Deliveries
[ ] Outcomes
[ ] Sessions
[x] In-App Messaging
[ ] REST API requests
[ ] Public API changes
Checklist
Overview
[x] I have filled out all REQUIRED sections above
[x] PR does one thing
If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
[x] Any Public API changes are explained in the PR details and conform to existing APIs
Testing
[x] I have included test coverage for these changes, or explained why they are not needed
[x] All automated tests pass, or I explained why that is not possible
[x] I have personally tested this on my device, or explained why that is not possible
Final pass
[x] Code is as readable as possible.
Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
[x] I have reviewed this PR myself, ensuring it meets each checklist item
WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.
Description
One Line Summary
Fix crash that can occur in some cases when we fail to load an IAM
Details
If multiple IAMs have the same trigger then we will have an IAM window that needs to be cleaned up when one of them fails to load. This fix was introduced in this pr, but the failure is not guaranteed to return on the UI thread so it would crash in some cases.
Motivation
Fix crash
Scope
IAM
Testing
Unit testing
none
Manual testing
Manually reproduced with break points and pausing active IAMs as they were about to load
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is