braze-inc / braze-swift-sdk

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

[Bug]: Braze InAppMessage Crash #76

Closed BrazeCJ closed 11 months ago

BrazeCJ commented 1 year ago

Platform

iOS

Platform Version

iOS 14 +

Braze SDK Version

5.11.0

Xcode Version

Xcode 14.2

Computer Processor

Intel

Repro Rate

100%

Steps To Reproduce

Example:

  1. Add braze.logCustomEvent(name: "custom_event") in AppDelegate.swift.
  2. Run the app.
  1. import BrazeUI
  2. add standard integration

Expected Behavior

It's difficult for users to be clear about which cases are crashing.

Actual Incorrect Behavior

It's difficult for users to be clear about which cases are crashing.

Verbose Logs

Firebase Crashlytics Error : 

 CJOne                          0x5db2a8 BrazeInAppMessageUI.SlideupView.presented.didset + 4310758056 (<compiler-generated>:4310758056)
1  CJOne                          0x5db33c BrazeInAppMessageUI.SlideupView.presented.setter + 379 (InAppMessageUISlideupView.swift:379)
2  CJOne                          0x5db950 BrazeInAppMessageUI.SlideupView.dismiss(completion:) + 417 (InAppMessageUISlideupView.swift:417)
3  CJOne                          0x5adb30 BrazeInAppMessageUI._objc_dismiss() + 195 (InAppMessageUI.swift:195)
4  CJOne                          0x5adb78 @objc BrazeInAppMessageUI._objc_dismiss() + 4310571896 (<compiler-generated>:4310571896)
5  CJOne                          0x15d584 +[NavigationControllerManager removeBrazeInAppMessageViewController] + 82 (NavigationControllerManager.m:82)
6  CJOne                          0x173bc8 -[NavigationController popViewControllerAnimated:] + 150 (NavigationController.m:150)
7  CJOne                          0x16cce8 -[WebViewController onClickBack:] + 264 (WebViewController.m:264)
8  UIKitCore                      0x249a34 -[UIApplication sendAction:to:from:forEvent:] + 100
9  UIKitCore                      0x249734 -[UIControl sendAction:to:forEvent:] + 112
10 UIKitCore                      0x2490c8 -[UIControl _sendActionsForEvents:withEvent:] + 324
11 UIKitCore                      0x248f6c -[UIButton _sendActionsForEvents:withEvent:] + 124
12 UIKitCore                      0x248b2c -[UIControl touchesEnded:withEvent:] + 400
13 UIKitCore                      0x12fe20 _UIGestureEnvironmentUpdate + 5808
14 CoreFoundation                 0x90234 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36
15 CoreFoundation                 0x1a410 __CFRunLoopDoObservers + 532
16 CoreFoundation                 0x7a19c __CFRunLoopRun + 1028
17 CoreFoundation                 0x7f3ec CFRunLoopRunSpecific + 612
18 GraphicsServices               0x135c GSEventRunModal + 164
19 UIKitCore                      0x39cf58 -[UIApplication _run] + 888
20 UIKitCore                      0x39cbbc UIApplicationMain + 340
21 CJOne                          0x17a128 main + 14 (main.m:14)
22 ???                            0x1e25c4dec (Missing)

Additional Information

Relatedly, are there any cases where a crash could occur for the verbose log?

jerielng commented 1 year ago

Hi @BrazeCJ, this looks like a case where there are some missing constraints at a time where the BrazeUI is trying to activate them. We'll dive into a fix and keep you updated here when it's been released. Thanks!

Relatedly, are there any cases where a crash could occur for the verbose log?

I'm not sure what you mean by this question. Could you clarify?

jerielng commented 11 months ago

Hi @BrazeCJ, we've just released 7.0.0 which adds some additional safeguards around this crash. If the SDK encounters some invalid values, it will avoid any crashes and should log an error to the stack trace.

Please let us know if you have any further questions. Thank you!

BrazeCJ commented 7 months ago

Hi @jerielng

I hope you are doing well. We have applied Swift SDK 7.2.0 at our customer based on the fix you mentioned, but the same error is occurring, so we are attaching the related logs.

Thanks, Dojin

com.cjone.CJOne_issue_89d25b06131159ffe27d89c962921ccc_crash_session_e67ae69c1ad74b55bb0be35c529bca4b_DNE_0_v2_stacktrace.txt

jerielng commented 7 months ago

@BrazeCJ We'll take a deeper look into this, but we aren't able to reproduce this crash on our end, so we'll need some additional information around your implementation. Could you share the campaign that is causing this along with any additional details you are observing about this crash with our support team at support@braze.com? Thanks!