Appboy / appboy-ios-sdk

Public repo for the Braze iOS SDK
https://www.braze.com
Other
165 stars 142 forks source link

Request feed refresh crashing sometimes #173

Closed J-Mendes closed 5 years ago

J-Mendes commented 5 years ago

Hi, I have some users that are having a crash when their app call requestFeedRefresh to update the news feed. I've tried to reproduce this but without success. Below there is the stacktrace that are generated along with some metadata details about the environment.

Info Value
Platform Name iOS
Platform Version 11.4.1 - 12.1.2
SDK Version 3.10.0+
Integration Method cocoapods
Xcode Version Xcode 10.1
Repro rate 5%

Stacktrace

0. Crashed: com.apple.main-thread

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000d2116f0fb0d0

0 libobjc.A.dylib 0x1be698d68 objc_msgSend + 8 1 CoreFoundation 0x1bf399054 -[NSArray initWithArray:range:copyItems:] + 280 2 CoreFoundation 0x1bf3ab7b8 -[NSPlaceholderArray initWithArray:copyItems:] + 196 3 Appboy_iOS_SDK 0x101bdb2b8 -[ABKEventLog copyWithZone:] (ABKEventLog.m:39) 4 Appboy_iOS_SDK 0x101bfe4d0 -[ABKDataServerRequest populateFromUserData:] (ABKDataServerRequest.m:85) 5 Appboy_iOS_SDK 0x101c2f1f8 -[ABKRequestDispatcher populatedRequestIsEmpty:] (ABKRequestDispatcher.m:290) 6 Appboy_iOS_SDK 0x101c2ed9c -[ABKRequestDispatcher consumeNextRequestInQueue] (ABKRequestDispatcher.m:237) 7 Appboy_iOS_SDK 0x101c2f8f0 -[ABKRequestDispatcher processRequestsRegardlessOfConnection] (ABKRequestDispatcher.m:365) 8 Appboy_iOS_SDK 0x101c2f5dc -[ABKRequestDispatcher consumeNextRequestInQueueIfWeHaveInternetConnectivity] (ABKRequestDispatcher.m:327) 9 Appboy_iOS_SDK 0x101c2f6e8 -[ABKRequestDispatcher consumeQueueIfWeHaveInternetConnectivity] (ABKRequestDispatcher.m:340) 10 Appboy_iOS_SDK 0x101c0b5fc -[ABKManager addRequestToFrontOfQueueAndFlushImmediately:] (ABKManager.m:237) 11 Appboy_iOS_SDK 0x101c0b84c -[ABKManager requestFeedRefresh] (ABKManager.m:252) 12 Appboy_iOS_SDK 0x101bcceac -[Appboy requestFeedRefresh] (Appboy.m:732) 13 App 0x101240840 $S4App20MainTabBarControllerC12updateFeed33_C7DE82661B22D47A4DD9D661B1E8F2D1LLyyypF (MainTabBarController.swift:268) 14 App 0x101242138 $S4App20MainTabBarControllerC12updateFeed33_C7DE82661B22D47A4DD9D661B1E8F2D1LLyyypFToTm + 4371292472 15 UIKitCore 0x1ec7c8454 + 96 16 UIKitCore 0x1ebf97b3c + 156 17 UIKitCore 0x1ebf97a6c + 172 18 UIKitCore 0x1ec7c8454 + 96 19 UIKitCore 0x1ec255d0c + 80 20 UIKitCore 0x1ec25602c + 440 21 UIKitCore 0x1ec25502c + 568 22 UIKitCore 0x1ec3dcaa8 + 4324 23 UIKitCore 0x1ec3d77a4 + 1236 24 CoreFoundation 0x1bf4407cc CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 32 25 CoreFoundation 0x1bf43b460 CFRunLoopDoObservers + 412 26 CoreFoundation 0x1bf43ba00 __CFRunLoopRun + 1264 27 CoreFoundation 0x1bf43b1f0 CFRunLoopRunSpecific + 436 28 GraphicsServices 0x1c16b4584 GSEventRunModal + 100 29 UIKitCore 0x1ec7c6d40 UIApplicationMain + 212 30 App 0x100f7e8a0 main (AppDelegate.swift:22) 31 libdyld.dylib 0x1beefabb4 start + 4

Bucimis commented 5 years ago

Hi @J-Mendes,

A few questions: 1) Are you calling requestFeedRefresh manually? If so, which thread are you calling it from? 2) Did you customize the news feed UI at all? 3) Does "5% repro rate" mean 5% of users are affected?

J-Mendes commented 5 years ago

Hi,

  1. Yes, I'm calling it manually from main thread.
  2. No, I plan to do it in the future but right now I'm not customizing the news feed UI.
  3. The 5% mean 5% of the users were affected by this

Thanks

Bucimis commented 5 years ago

@J-Mendes we still aren't able to repro unfortunately. Is there any common thread across the 5% of users affected?

J-Mendes commented 5 years ago

Unfortunately the only thing common on this users is the stacktrace above. Their environments vary a lot.

Bucimis commented 5 years ago

@J-Mendes is it possible for requestFeedRefresh to be called before startWithApiKey?

J-Mendes commented 5 years ago

I don't think so because startWithApiKey is called right after application is initialized and the call to requestFeedRefresh is made on a different context, a few screens after.

Bucimis commented 5 years ago

@J-Mendes, is it called synchronously within the didFinishLaunching method? Also, do you call wipeData or disableSDK anywhere in the app?

J-Mendes commented 5 years ago

Yes, I can confirm that it is called synchronously within the didFinishLaunching. The other two calls I don't use them.

Bucimis commented 5 years ago

@J-Mendes are you still seeing crashes? We still haven't been able to repro on our end unfortunately

J-Mendes commented 5 years ago

@Bucimis I still see them, but they are a lot less frequent right now. On my side I can't reproduce it either yet.

hokstuff commented 5 years ago

Hi @J-Mendes,

In our latest release, we implemented a patch that should improve performance when scrolling on the News Feed. You can find the 3.13.0 release here. Let us know if you are still experiencing issues!

Thanks!