Commit Graph

14 Commits

Author SHA1 Message Date
Evan Bacon cca3c13d2d Fixed Deadlock
Running this in a detached expo app can sometimes deadlock from thread issues.
I've replaced `dispatch_sync(dispatch_get_main_queue(), ^{});`  with `RCTUnsafeExecuteOnMainQueueSync(^{});` to fix this.

I only hit the error in the `RNFirebaseStorage.m` but it seems like the `RNFirebaseAnalytics.m` and `RNFirebase.m` modules could also have this same issue.

`RCTUnsafeExecuteOnMainQueueSync` checks to see if the method is being executed on the main thread before trying to sync to the main thread. If you try to sync on the main thread whilst on the main thread, you hit a deadlock.

You can read more about it here: https://stackoverflow.com/questions/12379059/why-is-this-dispatch-sync-call-freezing?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

The only testing I did was in a seperate detached ExpoKit project. Running this function would cause the crash.
```js
await firebase
      .storage()
      .ref(uploadUri)
      .putFile(uri);
```
2018-06-08 14:44:48 -07:00
Chris Bianca 0fe2fec819 [internals] More tidy up and hiding of internal functions 2018-01-03 20:00:38 +00:00
Chris Bianca 114e3b2b5b [ios] Explicitly set requiresMainQueueSetup to prevent warnings on app start 2017-10-12 09:18:01 +01:00
Salakar faf522d2d7 [ios] fix misc xcode warnings 2017-10-03 10:03:41 +01:00
Chris Bianca bb98c4f9e5 [ios] Change all library imports to use <> notation 2017-08-17 17:26:20 +01:00
Salakar 03377255f6 [core][both] added delete app method (android is just a stub method as the firebase sdk does not support it) 2017-07-18 06:02:53 +01:00
Salakar 075cd690ce [android][ios][core] initialize app parameters no longer prefixed by platform name i.e iosClientId becomes clientId. Use react native platform module to provide platform specific options. 2017-07-17 19:43:36 +01:00
Salakar 813b91f5ad [ios][app] apps initialized natively now automatically initialized js side - via react module getConstants 2017-07-17 18:20:27 +01:00
Salakar 80ae8425ce started work on multiple app initialization 2017-06-29 17:24:34 +01:00
Chris Bianca dcd6321561 [ios] Tidy up of iOS imports and other misc clean up 2017-05-31 09:54:02 +01:00
Salakar 278957f2ea [ios][all] removed < RN 40 conditional imports as RN 40 is now the minimum supported version 2017-05-27 15:28:24 +01:00
Salakar 0ef3a5341c [ios] cleanup/remove old code from RNFirebase.h/m 2017-05-25 15:01:53 +01:00
Akshet Pandey fdf60444fe Implement Firebase Remote Config for iOS 2017-05-19 16:17:28 -07:00
Salakar 05a35b7b82 ios - initial build 2017-03-09 15:26:28 +00:00