firedart icon indicating copy to clipboard operation
firedart copied to clipboard

Firestore.instance.collection(path).stream stop working after changing WiFi network

Open guyluz11 opened this issue 4 years ago • 3 comments

I am initializing Firestore and calling Firestore.instance.collection(path).stream and it is working.

If I change network while the app is running and calling Firestore.instance.collection(path).stream again new collection values are not arriving when being changed.

The last stream was canceled before the new one was being called.

Is there part of the library that fixed on the network that he got when it was initialized like the httpClient?.

guyluz11 avatar Jun 09 '21 19:06 guyluz11

I have the same issue running the app on a RPi with flutter-pi, but I have this problem without changing the wifi, I have it also running the app with the device connected using Ethernet cable. My code is

StreamBuilder<....>(
        stream: firebaseCollection.document(docName!).stream,
        builder: (context, snapshot) {
          if (snapshot.hasData) {
      ////
}
else {
            return Center(child: CircularProgressIndicator());
          }
        },
      ),

Do you think is the same issue because the Raspberry Pi reconnect to internet, or I should open a new issue? Any workaround to solve this issue with more code?

kekko7072 avatar Jun 09 '21 19:06 kekko7072

If I understand you correctly the stream stop working for you after number of hours without being closed and without showing any error?.

If so than I think that this is different issue than this one and you should open new issue about it.

guyluz11 avatar Jun 11 '21 12:06 guyluz11

If I understand you correctly the stream stop working for you after number of hours without being closed and without showing any error?.

If so than I think that this is different issue than this one and you should open new issue about it.

Correctly after 30 minutes it stops streaming. It happens when the Raspberry Pi it's connected to WifI but also when it is connected by cable.

kekko7072 avatar Jun 11 '21 14:06 kekko7072

Guys any update on this ?

pritam-explorex avatar Nov 14 '22 06:11 pritam-explorex

Guys any update on this ?

I have an open a pr that might solve this, can you test if you can reproduce this in my fork as well?

https://github.com/guyluz11/firedart

guyluz11 avatar Nov 14 '22 12:11 guyluz11

It's still happening, streams close without any msg/exception/error. I cloned your(@guyluz11) code into my project and ran it (cross-checked if your changes were present - from the PR).

Is there a workaround for this issue?

stabjul avatar Nov 21 '22 09:11 stabjul

Closed by #130

cachapa avatar Feb 22 '24 12:02 cachapa