From 07899f35bdf4cac7f3fceb0430194c98111e0707 Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Tue, 12 Dec 2023 10:54:04 -0500 Subject: [PATCH] Return `DeviceController#linkDevice` to synchronous processing --- .../textsecuregcm/controllers/DeviceController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DeviceController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DeviceController.java index 6523400fa..e2eefe2eb 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DeviceController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DeviceController.java @@ -181,7 +181,7 @@ public class DeviceController { @ApiResponse(responseCode = "429", description = "Too many attempts", headers = @Header( name = "Retry-After", description = "If present, an positive integer indicating the number of seconds before a subsequent attempt could succeed")) - public CompletableFuture linkDevice(@HeaderParam(HttpHeaders.AUTHORIZATION) BasicAuthorizationHeader authorizationHeader, + public DeviceResponse linkDevice(@HeaderParam(HttpHeaders.AUTHORIZATION) BasicAuthorizationHeader authorizationHeader, @NotNull @Valid LinkDeviceRequest linkDeviceRequest, @Context ContainerRequest containerRequest) throws RateLimitExceededException, DeviceLimitExceededException { @@ -255,7 +255,8 @@ public class DeviceController { .thenApply(accountAndDevice -> new DeviceResponse( accountAndDevice.first().getIdentifier(IdentityType.ACI), accountAndDevice.first().getIdentifier(IdentityType.PNI), - accountAndDevice.second().getId())); + accountAndDevice.second().getId())) + .join(); } @PUT