Hello @felangel,
first, thank you for this great package! It really makes implementing the BLoC pattern so much easier.
Now to my question:
In my current project I have multiple blocs listening to different firestore collections. When a user presses the logout button it should cancel all the stream subscriptions to firebase. Do you have a solution for that?
Hi @anatter 馃憢
Thanks for opening an issue and for the positive feedback!
Regarding your question, each bloc is independent and needs to dispose its own subscriptions when it is disposed (similar to a StatefulWidget). Can you please share a sample app with the problem you鈥檙e describing just so that I have a better understanding of your use-case? Thanks!
Thanks for your quick reply. I resolved my issue in the meantime.
I was calling FirebaseAuth.instance.singOut() before my blocs (which had open streams to firestore) were disposed. This triggered a Exception (com.google.firebase.firestore.FirebaseFirestoreException: PERMISSION_DENIED: Missing or insufficient permissions.) because I logged out of Firebase before I cancelled my subscriptions.
Most helpful comment
Thanks for your quick reply. I resolved my issue in the meantime.
I was calling
FirebaseAuth.instance.singOut()before my blocs (which had open streams to firestore) were disposed. This triggered a Exception (com.google.firebase.firestore.FirebaseFirestoreException: PERMISSION_DENIED: Missing or insufficient permissions.) because I logged out of Firebase before I cancelled my subscriptions.