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

iOS FirestackAuth crashing #256

Closed
ghuh opened this issue Jan 21, 2017 · 10 comments
Closed

iOS FirestackAuth crashing #256

ghuh opened this issue Jan 21, 2017 · 10 comments

Comments

@ghuh
Copy link
Contributor

ghuh commented Jan 21, 2017

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x18ad611b8 __exceptionPreprocess
1  libobjc.A.dylib                0x18979855c objc_exception_throw
2  CoreFoundation                 0x18ac44eac -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]
3  CoreFoundation                 0x18ac44d1c +[NSDictionary dictionaryWithObjects:forKeys:count:]
4  LetsBeChefs                    0x10030ab00 __30-[FirestackAuth listenForAuth]_block_invoke_2
5  LetsBeChefs                    0x10030db70 __59-[FirestackAuth userPropsFromFIRUserWithToken:andCallback:]_block_invoke
6  libdispatch.dylib              0x189bea1fc _dispatch_call_block_and_release
7  libdispatch.dylib              0x189bea1bc _dispatch_client_callout
8  libdispatch.dylib              0x189beed68 _dispatch_main_queue_callback_4CF
9  CoreFoundation                 0x18ad0e810 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
10 CoreFoundation                 0x18ad0c3fc __CFRunLoopRun
11 CoreFoundation                 0x18ac3a2b8 CFRunLoopRunSpecific
12 GraphicsServices               0x18c6ee198 GSEventRunModal
13 UIKit                          0x190c817fc -[UIApplication _run]
14 UIKit                          0x190c7c534 UIApplicationMain
15 LetsBeChefs                    0x10007ce18 main (main.m:16)
16 libdispatch.dylib              0x189c1d5b8 (Missing)

react-native-firestack v2.3.3

@skizzo
Copy link

skizzo commented Jan 28, 2017

Any updates on this? Happens to me too, using v2.3.9.

@ghuh
Copy link
Contributor Author

ghuh commented Jan 28, 2017

Nope, it's still crashing. Any Objective-C experts out there have any thoughts?

@skizzo
Copy link

skizzo commented Jan 28, 2017

Can confirm that this only happens

Can't believe we're the only ones having troubles with this, I don't recall making any special settings for my Firebase setup..

@ghuh
Copy link
Contributor Author

ghuh commented Jan 28, 2017

It's fairly intermittent. I didn't see the issue until I had hundreds of people logging in a day and then this started causing crashes for about 5% of my users. I haven't been able to reproduce it personally. @skizzo, if you have a reliable case for reproducing the issue, can you post it?

@ghuh
Copy link
Contributor Author

ghuh commented Jan 29, 2017

By sheer dumb luck I was able to reproduce this bug tonight in the simulator. It is far worse than I realized. After the app crashes, its state doesn't clear. So, the next time the user goes to open the app, it crashes again. Effectively rendering the app useless.

@auser would you be able to take a look or do you know an Objective-C developer that can take a look? Unfortunately my skill set is on Android, not iOS.

@Salakar
Copy link
Collaborator

Salakar commented Feb 1, 2017

@ghuh @skizzo - switch to my fork, its v3, ton of fixes / improvements

@mikemonteith
Copy link

mikemonteith commented Feb 13, 2017

I'm getting this error when a user has a token for an account that has been deleted on firebase. The error handling in listenForAuth is trying to get the error message with [error localizedFailureReason] instead of [error localizedDescription] as is used everywhere else.
I assume using localizedDescription will be fine, but I'm not really an ObjC developer. Does anyone know if this is the right change to make? Is there any reason why localizedFailureReason would be used instead?

https://github.com/mikemonteith/react-native-firestack/blob/master/ios/Firestack/FirestackAuth.m#L162

mikemonteith added a commit to mikemonteith/react-native-firestack that referenced this issue Feb 13, 2017
@ghuh
Copy link
Contributor Author

ghuh commented Feb 14, 2017

Thanks for coming up with a reproducible test case! It looks like the change you made already exists on v3 so I think it's likely that is a correct change (I too am not an objective-c developer).

It is worth noting there are other cases that trigger this exact same issue. It is not just when a user no longer exists.

@ghuh
Copy link
Contributor Author

ghuh commented Feb 14, 2017

See my comments on @mikemonteith PR. I did some digging in the firebase documentation and I'm convinced that his fix will solve this issue (I'm going to push out the change in my own code). I'll close out this PR as soon as it is merged.

@ghuh
Copy link
Contributor Author

ghuh commented Feb 26, 2017

I've pushed out @mikemonteith change to my production environment and confirmed that it has stopped this crash.

Since this change is in v3 and there is a PR out for v2, I'm going to go ahead and close this issue.

@ghuh ghuh closed this as completed Feb 26, 2017
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

No branches or pull requests

4 participants