mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 04:28:04 +01:00
Shift authority for disconnection requests to DisconnectionRequestManager
This commit is contained in:
committed by
Jon Chambers
parent
81f3ba17c7
commit
09fd5e8819
@@ -161,9 +161,8 @@ class WebSocketConnectionEventManagerTest {
|
||||
assertFalse(remoteEventManager.isLocallyPresent(accountIdentifier, deviceId));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(booleans = {true, false})
|
||||
void requestDisconnection(final boolean requestDisconnectionRemotely) throws InterruptedException {
|
||||
@Test
|
||||
void handleDisconnectionRequest() throws InterruptedException {
|
||||
final UUID accountIdentifier = UUID.randomUUID();
|
||||
final byte firstDeviceId = Device.PRIMARY_ID;
|
||||
final byte secondDeviceId = firstDeviceId + 1;
|
||||
@@ -198,10 +197,7 @@ class WebSocketConnectionEventManagerTest {
|
||||
assertFalse(firstListenerDisplaced.get());
|
||||
assertFalse(secondListenerDisplaced.get());
|
||||
|
||||
final WebSocketConnectionEventManager displacingManager =
|
||||
requestDisconnectionRemotely ? remoteEventManager : localEventManager;
|
||||
|
||||
displacingManager.requestDisconnection(accountIdentifier, List.of(firstDeviceId)).toCompletableFuture().join();
|
||||
localEventManager.handleDisconnectionRequest(accountIdentifier, List.of(firstDeviceId));
|
||||
|
||||
synchronized (firstListenerDisplaced) {
|
||||
while (!firstListenerDisplaced.get()) {
|
||||
|
||||
Reference in New Issue
Block a user