ebg11
ebg11

Reputation: 1046

Flutter firestore stream denied exception

In my flutter app I have an open stream that is listening to changes on a document on firestore. If I log the user out i receive the following exception:

[Firestore]: Listen for Query(THE_DOC_PATH) failed: Status{code=PERMISSION_DENIED, description=Missing or insufficient permissions., cause=null}
I/System.out( 6117): com.google.firebase.firestore.FirebaseFirestoreException: PERMISSION_DENIED: Missing or insufficient permissions.

I have a few questions

  1. Does the close the stream for me automatically?
  2. Are there any downsides to this happening? e.g. using extra reads on the doc or firestore rules
  3. Should i manually be closing the stream before the user signs out?

Thanks

Upvotes: 0

Views: 150

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317760

Does the close the stream for me automatically?

Yes. After an error like this, there will be no more items emitted from the stream.

Are there any downsides to this happening? e.g. using extra reads on the doc or firestore rules

There are no extra costs, if that's what you're implying.

Should i manually be closing the stream before the user signs out?

Typically, yes. But that's a matter of opinion, and it's up to you.

Upvotes: 1

Related Questions