Skip to content

Commit

Permalink
Revert "fix(datastore): Fix MutationProcessorRetryTest" (#2419)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpanshu committed Apr 27, 2023
1 parent fd6bcd8 commit 28737c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit
/**
* The ReachabilityMonitor is responsible for watching the network status as provided by the OS.
* It returns an observable that publishes "true" when the network becomes available and "false" when
* the network is lost.
* the network is lost. It publishes the current status on subscription.
*
* ReachabilityMonitor does not try to monitor the DataStore websockets or the status of the AppSync service.
*
Expand Down Expand Up @@ -64,6 +64,8 @@ private class ReachabilityMonitorImpl constructor(val schedulerProvider: Schedul
emitter = ObservableOnSubscribe { emitter ->
val callback = getCallback(emitter)
connectivityProvider.registerDefaultNetworkCallback(context, callback)
// Provide the current network status upon subscription.
emitter.onNext(connectivityProvider.hasActiveNetwork)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ class ReachabilityMonitorTest {
// Should provide true after debounce
testScheduler.advanceTimeBy(251, TimeUnit.MILLISECONDS)

testSubscriber.assertValues(false, true, true)
testSubscriber.assertValues(true, false, true, true)
}
}

0 comments on commit 28737c0

Please sign in to comment.