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

Firebase.database().ref().once() fires first time and after app refresh it doesn't fire #1601

Closed
gvetsa opened this issue Oct 15, 2018 · 3 comments

Comments

@gvetsa
Copy link

gvetsa commented Oct 15, 2018

Issue

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.

Environment

  1. Application Target Platform:

Android simulator

  1. Development Operating System:

Windows 10

  1. Build Tools:

  2. React Native version:

    "react-native": "0.57.0",

  3. React Native Firebase Version:

    "react-native-firebase": "^4.3.8",

  4. Firebase Module:

database

  1. Are you using typescript?

No


Loving react-native-firebase? Please consider supporting them with any of the below:

@guidotajan
Copy link

Same 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.

@afrakhan123
Copy link

afrakhan123 commented Oct 17, 2018

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

@Salakar
Copy link
Contributor

Salakar commented Oct 17, 2018

Hey @afrakhan123 @gvetsa @guidotajan, I started looking at this in #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 #1498 - let's continue the discussion over there so as not to duplicate.

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