bitstadium / HockeySDK-iOS

HockeyApp was retired and the SDKs are deprecated. Please use App Center instead.
https://github.com/microsoft/appcenter-sdk-apple
Other
597 stars 268 forks source link

lastSessionCrashDetails sometimes doesn't work right #511

Closed s-shestakov closed 4 years ago

s-shestakov commented 6 years ago

According to https://github.com/bitstadium/HockeySDK-iOS/blob/master/Documentation/Guides/Set%20Custom%20AlertViewHandler.md we can always use [[BITHockeyManager sharedHockeyManager].crashManager lastSessionCrashDetails] to get information about current crash. But it is not true. When this

    if (notApprovedReportFilename && !self.lastCrashFilename) {
      self.lastCrashFilename = [notApprovedReportFilename lastPathComponent];
    }

https://github.com/bitstadium/HockeySDK-iOS/blob/develop/Classes/BITCrashManager.m#L1085 happens, self.lastCrashFilename will be equal to first unhandled crash. But lastSessionCrashDetails will still contain info about the crash occured in the last session.

It would be better if there was a variable like "currentCrashDetails" with info about crash that is being processed right now

elamalani commented 6 years ago

@s-shestakov Thanks for reporting this issue. We will investigate it and get back to you on the next steps.

jaeklim commented 6 years ago

@s-shestakov I want to clarify your suggestion, do you want to get all pending crashes (happened in previous sessions) that are being processed in the current session?

s-shestakov commented 6 years ago

I want to get information about crash being processed in alertViewHandler (https://github.com/bitstadium/HockeySDK-iOS/blob/master/Documentation/Guides/Set%20Custom%20AlertViewHandler.md). In fact, we have made our custom handler. It tries to analyze a crash and decides crash should be sent or not. For example we do not want to send crashes from the "old" verisons of our app. To do that, we need information about crash.

Every crash will be sent to our custom handler, so it would be enough. We do not need all pending crashes at one time.

jaeklim commented 6 years ago

I understand. Unfortunately it doesn't allow you to choose crashes that need to be sent to server, not prioritized yet so we don't know when we can add the feature to HockeyApp. BTW have you tried AppCenter? We do have that specific feature in AppCenter Crashes, you can review all crashes before sending it to server, you can easily determine crashes in a delegate method and simply return YES(true) or NO(false). https://github.com/Microsoft/AppCenter-SDK-Apple/blob/develop/AppCenterCrashes/AppCenterCrashes/MSCrashesDelegate.h#L19 https://appcenter.ms

s-shestakov commented 6 years ago

We use custom alert view handler to filter crashes. In fact, we do not ask user in this handler, we just call handleUserInput with suitable arguments. However, information about current crash is needed for both variants of setAlertViewHandler usage: with user dialog or withou user dialog. Right now, an example here https://github.com/bitstadium/HockeySDK-iOS/blob/master/Documentation/Guides/Set%20Custom%20AlertViewHandler.md sometimes will show to user wrong information.

As for AppCenter. We are using HockeyApp for many years, it works well, and we have no plans to change it right now.