From 9491ebbe9024e7a6e0b9eb4b4ce046eaf13dcb45 Mon Sep 17 00:00:00 2001 From: Jonathan Klabunde Tomer <125505367+jkt-signal@users.noreply.github.com> Date: Thu, 6 Mar 2025 08:20:06 -0800 Subject: [PATCH] remove versionedExpirationTimer --- .../grpc/DeviceCapabilityUtil.java | 2 -- .../storage/DeviceCapability.java | 1 - .../main/proto/org/signal/chat/common.proto | 2 +- .../controllers/ProfileControllerTest.java | 5 +---- .../grpc/DevicesGrpcServiceTest.java | 11 +---------- .../textsecuregcm/storage/AccountTest.java | 19 ------------------- 6 files changed, 3 insertions(+), 37 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/grpc/DeviceCapabilityUtil.java b/service/src/main/java/org/whispersystems/textsecuregcm/grpc/DeviceCapabilityUtil.java index 269806b04..793ab7554 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/grpc/DeviceCapabilityUtil.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/grpc/DeviceCapabilityUtil.java @@ -18,7 +18,6 @@ public class DeviceCapabilityUtil { case DEVICE_CAPABILITY_STORAGE -> DeviceCapability.STORAGE; case DEVICE_CAPABILITY_TRANSFER -> DeviceCapability.TRANSFER; case DEVICE_CAPABILITY_DELETE_SYNC -> DeviceCapability.DELETE_SYNC; - case DEVICE_CAPABILITY_VERSIONED_EXPIRATION_TIMER -> DeviceCapability.VERSIONED_EXPIRATION_TIMER; case DEVICE_CAPABILITY_STORAGE_SERVICE_RECORD_KEY_ROTATION -> DeviceCapability.STORAGE_SERVICE_RECORD_KEY_ROTATION; case DEVICE_CAPABILITY_UNSPECIFIED, UNRECOGNIZED -> throw Status.INVALID_ARGUMENT.withDescription("Unrecognized device capability").asRuntimeException(); }; @@ -29,7 +28,6 @@ public class DeviceCapabilityUtil { case STORAGE -> org.signal.chat.common.DeviceCapability.DEVICE_CAPABILITY_STORAGE; case TRANSFER -> org.signal.chat.common.DeviceCapability.DEVICE_CAPABILITY_TRANSFER; case DELETE_SYNC -> org.signal.chat.common.DeviceCapability.DEVICE_CAPABILITY_DELETE_SYNC; - case VERSIONED_EXPIRATION_TIMER -> org.signal.chat.common.DeviceCapability.DEVICE_CAPABILITY_VERSIONED_EXPIRATION_TIMER; case STORAGE_SERVICE_RECORD_KEY_ROTATION -> org.signal.chat.common.DeviceCapability.DEVICE_CAPABILITY_STORAGE_SERVICE_RECORD_KEY_ROTATION; }; } diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/DeviceCapability.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/DeviceCapability.java index d0b0d88f7..6b2f3c892 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/DeviceCapability.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/DeviceCapability.java @@ -11,7 +11,6 @@ public enum DeviceCapability { STORAGE("storage", AccountCapabilityMode.ANY_DEVICE, false, false), TRANSFER("transfer", AccountCapabilityMode.PRIMARY_DEVICE, false, false), DELETE_SYNC("deleteSync", AccountCapabilityMode.ALL_DEVICES, true, true), - VERSIONED_EXPIRATION_TIMER("versionedExpirationTimer", AccountCapabilityMode.ALL_DEVICES, true, true), STORAGE_SERVICE_RECORD_KEY_ROTATION("ssre2", AccountCapabilityMode.ALL_DEVICES, true, true); public enum AccountCapabilityMode { diff --git a/service/src/main/proto/org/signal/chat/common.proto b/service/src/main/proto/org/signal/chat/common.proto index 6c78988a5..9bdeb7363 100644 --- a/service/src/main/proto/org/signal/chat/common.proto +++ b/service/src/main/proto/org/signal/chat/common.proto @@ -98,7 +98,7 @@ enum DeviceCapability { DEVICE_CAPABILITY_STORAGE = 1; DEVICE_CAPABILITY_TRANSFER = 2; DEVICE_CAPABILITY_DELETE_SYNC = 3; - DEVICE_CAPABILITY_VERSIONED_EXPIRATION_TIMER = 4; + reserved 4; DEVICE_CAPABILITY_STORAGE_SERVICE_RECORD_KEY_ROTATION = 5; } diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ProfileControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ProfileControllerTest.java index b2aebaffb..9cf91a58f 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ProfileControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ProfileControllerTest.java @@ -442,10 +442,8 @@ class ProfileControllerTest { @CartesianTest void testProfileCapabilities( - @CartesianTest.Values(booleans = {true, false}) final boolean isDeleteSyncSupported, - @CartesianTest.Values(booleans = {true, false}) final boolean isVersionedExpirationTimerSupported) { + @CartesianTest.Values(booleans = {true, false}) final boolean isDeleteSyncSupported) { when(capabilitiesAccount.hasCapability(DeviceCapability.DELETE_SYNC)).thenReturn(isDeleteSyncSupported); - when(capabilitiesAccount.hasCapability(DeviceCapability.VERSIONED_EXPIRATION_TIMER)).thenReturn(isVersionedExpirationTimerSupported); final BaseProfileResponse profile = resources.getJerseyTest() .target("/v1/profile/" + AuthHelper.VALID_UUID) .request() @@ -453,7 +451,6 @@ class ProfileControllerTest { .get(BaseProfileResponse.class); assertEquals(isDeleteSyncSupported, profile.getCapabilities().get("deleteSync")); - assertEquals(isVersionedExpirationTimerSupported, profile.getCapabilities().get("versionedExpirationTimer")); } @Test diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/grpc/DevicesGrpcServiceTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/grpc/DevicesGrpcServiceTest.java index 845a2807f..eea9581e2 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/grpc/DevicesGrpcServiceTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/grpc/DevicesGrpcServiceTest.java @@ -434,8 +434,7 @@ class DevicesGrpcServiceTest extends SimpleBaseGrpcTest expectedCapabilities = new HashSet<>(); @@ -476,10 +471,6 @@ class DevicesGrpcServiceTest extends SimpleBaseGrpcTest