Commit 7c7f1a93 authored by MozLando's avatar MozLando
Browse files

Merge #5910



5910: Closes #5909: Remove excessive polling for device events r=grigoryk a=jonalmeida
Co-authored-by: default avatarJonathan Almeida <jalmeida@mozilla.com>
parents 020ac64d 7b701d2f
......@@ -964,9 +964,8 @@ open class FxaAccountManager(
// If device supports SEND_TAB...
if (deviceConfig.capabilities.contains(DeviceCapability.SEND_TAB)) {
// ... update constellation state, and poll for any pending device events.
// ... update constellation state
account.deviceConstellation().refreshDevicesAsync().await()
account.deviceConstellation().pollForEventsAsync().await()
}
}
......
......@@ -609,7 +609,6 @@ class FxaAccountManagerTest {
// Assert that we do not refresh device state.
verify(constellation, never()).refreshDevicesAsync()
verify(constellation, never()).pollForEventsAsync()
// Finally, assert that we see an account with an inflight migration.
assertNotNull(manager.authenticatedAccount())
......@@ -678,7 +677,6 @@ class FxaAccountManagerTest {
// Assert that we refresh device state.
verify(constellation).refreshDevicesAsync()
verify(constellation).pollForEventsAsync()
// Assert that persistence callback is interacting with the storage layer.
account.persistenceCallback!!.persist("test")
......@@ -1103,7 +1101,6 @@ class FxaAccountManagerTest {
// Assert that we don't refresh device state for non-SEND_TAB enabled devices.
verify(constellation, never()).refreshDevicesAsync()
verify(constellation, never()).pollForEventsAsync()
// Make sure 'logoutAsync' clears out state and fires correct observers.
reset(accountObserver)
......@@ -1843,7 +1840,6 @@ class FxaAccountManagerTest {
private fun mockDeviceConstellation(): DeviceConstellation {
val c: DeviceConstellation = mock()
`when`(c.refreshDevicesAsync()).thenReturn(CompletableDeferred(true))
`when`(c.pollForEventsAsync()).thenReturn(CompletableDeferred(true))
return c
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment