Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix(datastore): Fix MutationProcessorRetryTest" #2419

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
}