Open fossage opened 1 month ago
Hi @fossage. Thanks for reaching out and sharing the details. Sorry for the inconvenience caused by this issue. The logs are really helpful and will help us in investigating the possible issue. We'll take a closer look at the code and get back to you with more details. Meanwhile, can you please answer the following:
dismissMessage
anywhere in your app? If yes, can you please share where you are calling it, e.g., on message action, when navigating away from a specific screen, when leaving the app, etc.?Thanks again for sharing the details. These questions might help us narrow down the issue and find the root cause which will help in fixing and verifying the changes. Appreciate your patience and help in identifying the issue.
@mrehan27 thanks for the follow up.
InAppMessageEventType.messageActionTaken
and InAppMessageEventType.messageDismissed
events that will explicitly call the CustomerIO.inAppMessaging().dismissMessage()
method. In talking with the person who implemented this logic, they couldn't quite recall why we needed it in the InAppMessageEventType.messageDismissed
case, but I would guess that it was because we had seen times where the message didn't dismiss appropriately so this was a fallback or something. I'm not sure if that was the actual reason so I wouldn't spend any time investigating it, but we put it there for some explicit reason, haha. For the InAppMessageEventType.messageActionTaken
event, we had it there to explicitly dismiss the message after the user interacted with it in any way.In writing out the above, the explicit call to CustomerIO.inAppMessaging().dismissMessage()
after receiving the InAppMessageEventType.messageDismissed
event definitely seems like it could be the culprit. We can experiment with removing that, but curious if you have any more insights.
Thank you for the great details. We have noted this down and will take a look to see if we can improve anything to minimize the crash occurrence.
However, with the current implementation, if you can remove dismissMessage
call from messageDismissed
that might help you reduce this crash. The messageDismissed
is called only when the message is already being dismissed with animation, and because there is another attempt to dismiss the same message again, this is potentially causing the crash.
I can't think of any use case where you would need to call dismissMessage
in messageDismissed
, but if you or anyone from your team has any case in mind that makes you keep the method there, do let us know so we can note it down for future improvements.
@mrehan27 , we have released an update where we are no longer explicitly calling CustomerIO.inAppMessaging().dismissMessage()
after receiving the InAppMessageEventType.messageDismissed
event but unfortunately we are still getting the error in the latest release, albeit with about half the frequency. It is worth noting that we still have a listener set up for the InAppMessageEventType.messageActionTaken
event which explicitly calls CustomerIO.inAppMessaging().dismissMessage()
. I'm starting to wonder if any calls to CustomerIO.inAppMessaging().dismissMessage()
have the potential to cause this error.
@fossage Thanks a lot for the updates. Sorry to hear that the issue is still occurring, though it's good to know the occurrences have been reduced. I'll discuss this with team internally to prioritize any possible fix and keep sharing updates here on any progress we make.
Thanks again for your patience and feedback.
SDK version: 3.6.0
Environment: Production
Are logs available? No, but we do have crash logs from our error logging software.
Describe the bug
To Reproduce Not able to reproduce locally unfortunately.
Expected behavior The app does not crash
Additional context
Pods/CustomerIOMessagingInApp/Sources/MessagingInApp/Gist/Managers/ModalViewManager.swift:63:16