Closed vicsuccess closed 1 month ago
Hi @vicsuccess, thanks for raising this. It seems that there is some kind of race condition occurring here where the constraints are not allocated for some reason at the time of dismissal. We've tried to safeguard around this by adding an error handling scenario.
Could you share further details on how you are presenting the IAM? I see that you have implemented a dismiss function. If you can provide some kind of project that reproduces this error to our support team support@braze.com, that would be helpful. Thank you!
HI @jerielng
When the app is sent to the background while Screen A is displayed, an IAM message is sent from the Braze development console, and then Screen A is brought to the foreground and transitions to Screen B, dismissing in viewDidAppear, repeating this scenario causes a crash at the point of dismissing while entering Screen B.
We are operating a large-scale service, so your assistance in resolving this issue is greatly appreciated. Please leave additional comments if necessary. (I hope to proceed with communication through this thread.)
Hey @vicsuccess, do you happen to have any sample code you can share that easily reproduces the issue? Or any verbose logs that show the order and history of the view presentation? We would also like to understand if this is occurring only on slide-up in-app messages, or for other message types - if you have any campaigns that you can share, this would be helpful and speed up the debugging process. Since campaign links are unique to your user account, we recommend sending these to our support email rather than sharing them on a public thread.
When you mention repeating this scenario causes a crash at the point of dismissing while entering Screen B.
, do you mean that this always happens on a second attempt at dismissing the screen?
We are open to the idea of making these values optional rather than force-unwrapping but would like to understand the error scenario more deeply to prevent it from manifesting in a different way that is more difficult to debug (i.e. the view dimensions not displaying correctly or causing an issue or crash elsewhere).
Hi @jerielng Sorry for the delay in replying due to work. I will leave a comment as soon as possible.
@jerielng I apologize for the delay in further communication. I have sent an email that includes more detailed information, including the steps to reproduce the crash situation. I appreciate your assistance with this matter.
Thank you.
Platform
iOS
Platform Version
iOS 17.4.1
Braze SDK Version
8.4.0
Xcode Version
Xcode 15.3
Computer Processor
Apple (M1)
Repro Rate
1%
Steps To Reproduce
Expected Behavior
BrazeInAppMessageUI dismisses correctly.
Actual Incorrect Behavior
In the BrazeInAppMessageUI's
func dismiss(completion: (() -> Void)? = nil)
, intermittent crashes occur due to force unwrapping of the following items at the time when presented is set in didSetResolve intermittent crashes by making the variables optional.
Verbose Logs
Please refer to the Xcode console log
Additional Information
No response