FirebaseFirestore.addCollectionSnapshotListener is not working correctly on iOS and Android #917
divinitas-art
started this conversation in
General
Replies: 1 comment
-
|
Well when i updated the ios and android firebase sdk versions to the latest ones - it completely stopped doing that and it works now... it broke emaillink in authentication, because new versions work with it differently... but i dont use that function so for me its solved for now... But this is somethign to have in mind - older version of sdks obviously had some sort of bug in them |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When i call FirebaseFirestore.addCollectionSnapshotListener it simply doesnt subscribe to the data when its called too soon after authentication using authentication plugin happens. And no error is produced, it just silently dont work and no updates on data comes in.
(only on iOS and Android, web is working correctly)
I didnt file the bug report yet because i dont have time to do minimal reproducible code for now...
but what i do is i set current user using FirebaseAuthentication.addListener('authStateChange', (change) => {
when user is set, the async code starts doing a routine to subscribe to data in which i subscribe to multiple collections using FirebaseFirestore.addCollectionSnapshotListener. it produces no errors, but sometimes doesnt subscribe (never on web, there it works every time, on ios and android, it doesnt)
I "solved" it by subscribing again in lets say 5 seconds... but even that sometimes doesnt work, very sparingly, but even 5 seconds after user is authenticated the subscription simply doesnt fire and doesnt update the data...
I can patch the native code for me for now... if anyone would know what even might be wrong here? Why would it sometimes work and sometimes not? Is there some potential race condition with the authentication plugin?
I am now starting to unravel this, so if i will have any more info i will add it as soon as i have it.
Beta Was this translation helpful? Give feedback.
All reactions