File tree 2 files changed +14
-1
lines changed
packages/firestore/src/remote 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " firebase " : patch
3
+ " @firebase/firestore " : patch
4
+ ---
5
+
6
+ [ fixed] Removed a delay that may have prevented Firestore from immediately
7
+ reestablishing a network connection if a connectivity change occurred while
8
+ the app was in the background.
Original file line number Diff line number Diff line change @@ -153,8 +153,11 @@ export class RemoteStore implements TargetMetadataProvider {
153
153
connectivityMonitor : ConnectivityMonitor
154
154
) {
155
155
this . connectivityMonitor = connectivityMonitor ;
156
- this . connectivityMonitor . addCallback ( ( status : NetworkStatus ) => {
156
+ this . connectivityMonitor . addCallback ( ( _ : NetworkStatus ) => {
157
157
asyncQueue . enqueueAndForget ( async ( ) => {
158
+ // Porting Note: Unlike iOS, `restartNetwork()` is called even when the
159
+ // network becomes unreachable as we don't have any other way to tear
160
+ // down our streams.
158
161
if ( this . canUseNetwork ( ) ) {
159
162
logDebug (
160
163
LOG_TAG ,
@@ -761,6 +764,8 @@ export class RemoteStore implements TargetMetadataProvider {
761
764
this . offlineCauses . add ( OfflineCause . ConnectivityChange ) ;
762
765
await this . disableNetworkInternal ( ) ;
763
766
this . onlineStateTracker . set ( OnlineState . Unknown ) ;
767
+ this . writeStream . inhibitBackoff ( ) ;
768
+ this . watchStream . inhibitBackoff ( ) ;
764
769
this . offlineCauses . delete ( OfflineCause . ConnectivityChange ) ;
765
770
await this . enableNetworkInternal ( ) ;
766
771
}
You can’t perform that action at this time.
0 commit comments