From dcdf401f6456d764d7e3c6e5e5b2685413430c85 Mon Sep 17 00:00:00 2001 From: Ravi Khadiwala Date: Wed, 14 Feb 2024 13:36:36 -0600 Subject: [PATCH] Make DELETE /v1/device synchronous --- .../textsecuregcm/controllers/DeviceController.java | 4 ++-- 1 file changed, 2 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 07b56c406..5de816357 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DeviceController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DeviceController.java @@ -126,7 +126,7 @@ public class DeviceController { @Produces(MediaType.APPLICATION_JSON) @Path("/{device_id}") @ChangesDeviceEnabledState - public CompletableFuture removeDevice(@Auth AuthenticatedAccount auth, @PathParam("device_id") byte deviceId) { + public void removeDevice(@Auth AuthenticatedAccount auth, @PathParam("device_id") byte deviceId) { if (auth.getAuthenticatedDevice().getId() != Device.PRIMARY_ID) { throw new WebApplicationException(Response.Status.UNAUTHORIZED); } @@ -135,7 +135,7 @@ public class DeviceController { throw new ForbiddenException(); } - return accounts.removeDevice(auth.getAccount(), deviceId).thenApply(Util.ASYNC_EMPTY_RESPONSE); + accounts.removeDevice(auth.getAccount(), deviceId).join(); } @GET