I am using ref.once() method and it fires properly the first time but after app refresh it doesn't throw exception or returns data the app just got stuck over there.
I have to redeploy the jar on the android simulator to make it work again and then it stops working again after refresh.
Android simulator
Windows 10
Build Tools:
React Native version:
"react-native": "0.57.0",
React Native Firebase Version:
"react-native-firebase": "^4.3.8",
Firebase Module:
database
typescript?No
Loving react-native-firebase? Please consider supporting them with any of the below:
React Native Firebase and Invertase on TwitterSame here.
I dived into the logcat and found this:
10-16 21:36:00.085 20444 20525 W MessageQueue: java.lang.IllegalStateException: Handler (android.os.Handler) {4d4228b} sending message to a Handler on a dead thread
10-16 21:36:00.085 20444 20525 W MessageQueue: at android.os.MessageQueue.enqueueMessage(MessageQueue.java:543)
10-16 21:36:00.085 20444 20525 W MessageQueue: at android.os.Handler.enqueueMessage(Handler.java:643)
10-16 21:36:00.085 20444 20525 W MessageQueue: at android.os.Handler.sendMessageAtTime(Handler.java:612)
10-16 21:36:00.085 20444 20525 W MessageQueue: at android.os.Handler.sendMessageDelayed(Handler.java:582)
10-16 21:36:00.085 20444 20525 W MessageQueue: at android.os.Handler.post(Handler.java:338)
10-16 21:36:00.085 20444 20525 W MessageQueue: at com.google.firebase.database.zza.zza(com.google.firebase:firebase-database@@16.0.2:1029)
10-16 21:36:00.085 20444 20525 W MessageQueue: at com.google.firebase.database.obfuscated.zzcd.zza(com.google.firebase:firebase-database@@16.0.2:47)
10-16 21:36:00.085 20444 20525 W MessageQueue: at com.google.firebase.database.obfuscated.zzab.zza(com.google.firebase:firebase-database@@16.0.2:286)
10-16 21:36:00.085 20444 20525 W MessageQueue: at com.google.firebase.database.obfuscated.zzab.zzb(com.google.firebase:firebase-database@@16.0.2:634)
10-16 21:36:00.085 20444 20525 W MessageQueue: at com.google.firebase.database.Query$3.run(com.google.firebase:firebase-database@@16.0.2:239)
10-16 21:36:00.085 20444 20525 W MessageQueue: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
10-16 21:36:00.085 20444 20525 W MessageQueue: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
10-16 21:36:00.085 20444 20525 W MessageQueue: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:272)
10-16 21:36:00.085 20444 20525 W MessageQueue: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
10-16 21:36:00.085 20444 20525 W MessageQueue: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
10-16 21:36:00.085 20444 20525 W MessageQueue: at java.lang.Thread.run(Thread.java:762)
It only happens after reloading or with the Debug JS Remotely mode. Restart the app is enough to make it work again but as soon as you reload it does not work anymore.
Same for me. When a component unmounts and remounts again, and even when the app is closed and removed from the background and opened again, it does not get the new data added to the database
Hey @afrakhan123 @gvetsa @guidotajan, I started looking at this in https://github.com/invertase/react-native-firebase/pull/1535 but got pulled away fixing more pressing issues sorry 馃檲
@guidotajan thanks for the stack trace, that's actually very helpful and gives me something else I can check.
I'll take another crack at this tonight/tomorrow and report back over at https://github.com/invertase/react-native-firebase/issues/1498 - let's continue the discussion over there so as not to duplicate.
Most helpful comment
Same for me. When a component unmounts and remounts again, and even when the app is closed and removed from the background and opened again, it does not get the new data added to the database