braze-inc / braze-swift-sdk

Braze SDK for the Apple ecosystem, including: iOS, macOS, iPadOS, visionOS, tvOS
https://www.braze.com
Other
52 stars 19 forks source link

[Bug]: Crash in ABKInAppMessageHTMLBaseViewController.m - Line 116 #63

Closed kkaliher closed 1 year ago

kkaliher commented 1 year ago

Platform

iOS

Platform Version

iOS 13+

Braze SDK Version

6.0.0 - BrazeUICompat

Xcode Version

14.2

Computer Processor

Apple (M1)

Repro Rate

affecting 5% of users, though we are not able to repro

Steps To Reproduce

We have not been able to repro. Crash is from ABKInAppMessageWindowController line 88 viewDidLoad > ABKInAppMessageHTMLBaseViewController.m - Line 116 viewDidLoad > Crash: Fatal Exception: NSInvalidArgumentException localhost/index.html is not a file URL

Expected Behavior

BrazeUICompat kit supports in-app messages and handles any errors gracefully without crashing

Actual Incorrect Behavior

We had one IAM running and it appeared to be crashing every time. We turned it off using an app version isNot filter, and crashes stopped.

Verbose Logs

Fatal Exception: NSInvalidArgumentException
localhost/index.html is not a file URL
0
CoreFoundation
__exceptionPreprocess
3
WebKit
(Missing UUID 4d3116e073df39d4a87c58a8f2adb9cb)
4
Sanctuary
ABKInAppMessageHTMLBaseViewController.m - Line 116
-[ABKInAppMessageHTMLBaseViewController viewDidLoad] + 116
5
UIKitCore
-[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled]
7
UIKitCore
-[UIViewController view]
8
Sanctuary
ABKInAppMessageWindowController.m - Line 88
-[ABKInAppMessageWindowController viewDidLoad] + 88
9
UIKitCore
-[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled]
14
UIKitCore
-[UIWindow _setHidden:forced:]
15
Sanctuary
ABKInAppMessageWindowController.m - Line 325
__72-[ABKInAppMessageWindowController displayInAppMessageViewWithAnimation:]_block_invoke + 325
16
libdispatch.dylib
_dispatch_call_block_and_release
25
UIKitCore
UIApplicationMain
26
Sanctuary
AppDelegate.swift - Line 41
main + 41

Additional Information

No response

kkaliher commented 1 year ago

We had just completed the minimal migration documented here: https://braze-inc.github.io/braze-swift-sdk/documentation/braze/appboy-migration-guide/

jerielng commented 1 year ago

Hey @kkaliher, thanks for the detailed information! Based on the presence of localhost in the URL, it looks like there may be an issue with the baseURL property in the HTML in-app messages or perhaps a failure in deserializing the IAM at some point. We'll take a deeper look and keep you posted on any updates.

lowip commented 1 year ago

Hey @kkaliher, we have just released the SDK 6.2.0 which addresses this crash. Thanks for your patience.