-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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().on() fires only once with Live Reload #1498
Comments
@Ehesp |
Same issue is happening with me after updating to react native 0.57.1. For me even hot reloading stops giving data from firebase.on |
@barbarosh what version of RNFB are you on? Are you able to try v5 - published today: https://invertase.link/rnfb-v5 |
Ok thanks, I have a rough idea now what it could be, will take a look today |
Hey all, could someone locally apply the PR I just sent up and let me know the result - thanks 👍 Loving
|
@Salakar It doesn't seem to have an effect on my side
|
Daft question sorry 🙈 but just to double check, did you re-build and re-install the APK after making the changes? Could you add some logging in the onHostDestroy method and inside the iterators |
@Salakar I don't think the fix worked. After hot reloading it still doesn't gives you data. To reproduce issue you will have to do Hot reload and all listeners would stop giving data. |
Having the same issue here with: |
Same here aswell. However it seems that it doesn't matter whether I use live reload or not. Same issue with live reload disabled and reloading app manually // package.json //app/build.gradle |
Same to me with (i try to patch according to #1535 but doesn works) // package.json //app/build.gradle |
Thanks to the stack trace provided by @guidotajjan in #1601 I think I know what the cause is now will re-attempt a fix today/tomorrow 👍 |
I think the pr doesn't solve this problem.
Still got the same messages on android logcat :
|
@FinCendikia what RN version are you on - I'm unable to reproduce this when using the PR + RN 57.x |
@Salakar I'm using Everything works fine until the reload. |
I have the same problem, with the difference that I'm using Firestore |
Hey @Raullg98, thanks for the heads up, I will do the same for Firestore next once I can confirm the fix for DB is working 🤞 |
Guys using these versions of firebase deps in my build.gradle file solved the issue.
with |
@ruvice117 I have the same issue even with the dependencies you listed. I can update |
any fix to this problem yet? Very significant issue. |
All, I've tested #1619 and this is definitely working as a fix for RN reload issues, you can see the test suites for reloading here: 2cf778b If I'm missing a test case then let me know (tag me here or ping me on discord), otherwise, I think this is resolved and ready for v5.1.0. You can give it a go now on the Thanks ❤️ Loving
|
- [ANDROID] [BUGFIX] [DATABASE] - Database listeners now correctly tearing down between RN reloads. (Fixes #1498 #1611 #1609) - [JS] [BUGFIX] [DATABASE] - Fixed an issue where `Reference.toString()` incorrectly contains `//` instead of `/` when joining the parent and child paths. - [JS] [BUGFIX] [DATABASE] - Rework `.push()` behaviour to match WebSDK and correctly return a Reference instance in all scenarios. (Fixes #893 #1464 #1572) - [JS] [ENHANCEMENT] [UTILS] - Added a `firebase.utils().database.cleanup()` utility method which removes all database listeners.
Hello! Forgive me if it's a dumb question, I'm very new to React Native. To get the fix would I need to update my package.json file to look like this: "react-native-firebase": "^5.1.0-rc2"? Also, any idea on when 5.1.0 will be out? |
@HomeSchoolDev 5.1.0 is out now: https://github.com/invertase/react-native-firebase/releases :) |
@Ehesp My mistake for missing that. Thank you! :) |
Using 5.1.0 here and still seeing the issue. I have problems with firebase.auth().onAuthStateChanged callbacks & live reload. |
@olegwn hi what platform? Could you make an issue with the details and tag me in it - thanks |
@Salakar this has been fixed in 5.2.0 release, I no longer see the issue |
I am also seeing this issue on
|
Ignore me, I downgraded to |
@danwoodbury @olegwn Thanks |
This worked for me as well, thanks! |
This is still happening for me in |
Don't know if it's useful or not (sorry if it's not!), but it still happens for me on |
the problems is that the off if never called when user close app (in my case)
y try to add a await to off and use callback but didn't work |
I am facing the same issue with firebase-firestore |
The v5.x.x branch is in maintenance mode now, if this can't be reproduced on v6 it is unlikely to gain attention, and any attention it will receive will be for that branch. I'm the one doing v5 releases and I only have time to integrate community fixes, so any fix for it will need to be proposed by someone else, then I'll shepherd it to release. The linked PRs here and/or an examination of the diffs from 5.2.0 to 5.2.2 should probably show the way |
I'm still facing it. v6.3.4 Update: Upgraded to 6.7.1 and still ref().on() fires once (snapsot.val() is null). |
I'm still getting this issue on v18.5.0 |
I'm on an Android, Connected Device, with Live Reload enabled
I use Firebase for Auth and Realtime Database
After Live Reload fires (each time I save a file, basically),
firebase.database().ref().on()
stops working.Here is my code:
I have a Redux Action to retrieve datas from the logged user
And I call this action in a pretty simple Component (screen)
This piece of code works perfectly.. only once. When Live Reload fires, it won't work anymore.
Note that
firebase.auth()
still works and gives me the rightuid
, butfirebase.database().ref('users/' + currentUser.uid).on('value')
won't fire anymore, even if I sign out then sign in again.Also note that it works perfectly with Hot Reloading whereas it doesn't with Live Reloading.
I have to
npm run android
(which is equal toreact-native run-android
) for it to fire again.. until the next Live Reload.The text was updated successfully, but these errors were encountered: