Listening to a new document does not work. #12132
Unanswered
MauroGentile
asked this question in
Q&A
Replies: 0 comments
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.
-
In the init of a Flutter GetxController I call these 2 methods:
fetchUserData();
listenUserInfo();
defined as
The listener above works fine on users already existing in Firestore but fails to listen to changes if the document has just been created.
In other words, if I launch the application and register a new user, the corresponding document is automatically created in Firestore. Then I set up the listener on the document just created, but changes are not detected.
To make it work, after creating the user, I have to restart the application. Alternatively, I have to introduce a delay of roughly 1 sec but either of teh above solutions is not really convenient in production.
I assume this is not a bug. I guess there is something I am missing in my code. Guidance would be very much appreciated
Beta Was this translation helpful? Give feedback.
All reactions