aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Remote/FSTRemoteStore.mm
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/Source/Remote/FSTRemoteStore.mm')
-rw-r--r--Firestore/Source/Remote/FSTRemoteStore.mm6
1 files changed, 5 insertions, 1 deletions
diff --git a/Firestore/Source/Remote/FSTRemoteStore.mm b/Firestore/Source/Remote/FSTRemoteStore.mm
index 4309c74..4d8aa7e 100644
--- a/Firestore/Source/Remote/FSTRemoteStore.mm
+++ b/Firestore/Source/Remote/FSTRemoteStore.mm
@@ -323,11 +323,15 @@ static const int kMaxPendingWrites = 10;
"enabled");
[self cleanUpWatchStreamState];
- [self.onlineStateTracker handleWatchStreamFailure];
// If the watch stream closed due to an error, retry the connection if there are any active
// watch targets.
if ([self shouldStartWatchStream]) {
+ if (error) {
+ // There should generally be an error if the watch stream was closed when it's still needed,
+ // but it's not quite worth asserting.
+ [self.onlineStateTracker handleWatchStreamFailure:error];
+ }
[self startWatchStream];
} else {
// We don't need to restart the watch stream because there are no active targets. The online