Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when reattempting the request #391

Closed
ogres opened this issue Jul 31, 2018 · 2 comments · Fixed by #394
Closed

Crash when reattempting the request #391

ogres opened this issue Jul 31, 2018 · 2 comments · Fixed by #394

Comments

@ogres
Copy link

ogres commented Jul 31, 2018

I am using OneSignal v 2.8.5 and having crashes.

Here is a crash log:

Crashed: com.apple.main-thread
0  MyApp                          0x103496abc -[OneSignalClient executeRequest:onSuccess:onFailure:] (OneSignalClient.m:111)
1  MyApp                          0x1034979c0 -[OneSignalClient reattemptRequest:] (OneSignalClient.m:185)
2  Foundation                     0x184cbc4ac __NSFireDelayedPerform + 408
3  CoreFoundation                 0x18422faa8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
4  CoreFoundation                 0x18422f76c __CFRunLoopDoTimer + 864
5  CoreFoundation                 0x18422f010 __CFRunLoopDoTimers + 248
6  CoreFoundation                 0x18422cb60 __CFRunLoopRun + 2168
7  CoreFoundation                 0x18414cda8 CFRunLoopRunSpecific + 552
8  GraphicsServices               0x186132020 GSEventRunModal + 100
9  UIKit                          0x18e16c758 UIApplicationMain + 236
10 MyApp                          0x102ba8d3c main (main.m:13)
11 libdyld.dylib                  0x183bddfc0 start + 4

onesignal

It crashes on this line: https://github.com/OneSignal/OneSignal-iOS-SDK/blob/master/iOS_SDK/OneSignalSDK/Source/OneSignalClient.m#L111

This might be connected to NSStringFromClass usage, maybe in Release mode optimisations are removing some info for this method to function properly.

Or failureBlock can be nil ....

Unfortunately I could not reproduce it myself.
But, looks like it happens when there are some requests saved to re-attempt, then user removes consent and then reattempt tries to fail with error message.

@Nightsd01
Copy link
Contributor

@ogres Even in release builds, NSStringFromClass would still work - it's definitely the nil failureBlock causing the issue. Good catch!

Nightsd01 added a commit that referenced this issue Aug 1, 2018
• In the OneSignalClient class that handles network request logic, there were rare cases where the SDK was attempting to execute blocks that could potentially be nil
• Adds checks to ensure these blocks aren't executed if they're nil (fixes #391)
Nightsd01 added a commit that referenced this issue Aug 6, 2018
• In the OneSignalClient class that handles network request logic, there were rare cases where the SDK was attempting to execute blocks that could potentially be nil
• Adds checks to ensure these blocks aren't executed if they're nil (fixes #391)
@ogres
Copy link
Author

ogres commented Aug 7, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants