From 9dc807a255950e8905b5b350ecf1559eb4969385 Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Mon, 23 Mar 2026 16:43:44 -0400 Subject: [PATCH] Remove the "unrecognized UA" remote deprecation reason --- .../dynamic/DynamicRemoteDeprecationConfiguration.java | 10 ++-------- .../textsecuregcm/filters/RemoteDeprecationFilter.java | 7 +------ .../filters/RemoteDeprecationFilterTest.java | 3 +-- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicRemoteDeprecationConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicRemoteDeprecationConfiguration.java index 4749bf0c1..42db9d838 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicRemoteDeprecationConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicRemoteDeprecationConfiguration.java @@ -16,15 +16,13 @@ public record DynamicRemoteDeprecationConfiguration( @NotNull Map minimumVersions, @NotNull Map versionsPendingDeprecation, @NotNull Map> blockedVersions, - @NotNull Map> versionsPendingBlock, - @NotNull Boolean unrecognizedUserAgentAllowed) { + @NotNull Map> versionsPendingBlock) { public static DynamicRemoteDeprecationConfiguration DEFAULT = new DynamicRemoteDeprecationConfiguration( Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(), - Collections.emptyMap(), - true); + Collections.emptyMap()); public DynamicRemoteDeprecationConfiguration { if (minimumVersions == null) { @@ -42,9 +40,5 @@ public record DynamicRemoteDeprecationConfiguration( if (versionsPendingBlock == null) { versionsPendingBlock = DEFAULT.versionsPendingBlock(); } - - if (unrecognizedUserAgentAllowed == null) { - unrecognizedUserAgentAllowed = DEFAULT.unrecognizedUserAgentAllowed(); - } } } diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilter.java b/service/src/main/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilter.java index 0f40c304d..5363ff5e8 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilter.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilter.java @@ -52,7 +52,6 @@ public class RemoteDeprecationFilter implements Filter, ServerInterceptor { private static final String REASON_TAG_NAME = "reason"; private static final String EXPIRED_CLIENT_REASON = "expired"; private static final String BLOCKED_CLIENT_REASON = "blocked"; - private static final String UNRECOGNIZED_UA_REASON = "unrecognized_user_agent"; public RemoteDeprecationFilter(final DynamicConfigurationManager dynamicConfigurationManager) { this.dynamicConfigurationManager = dynamicConfigurationManager; @@ -110,11 +109,7 @@ public class RemoteDeprecationFilter implements Filter, ServerInterceptor { boolean shouldBlock = false; if (userAgent == null) { - if (configuration.unrecognizedUserAgentAllowed()) { - return false; - } - recordDeprecation(null, UNRECOGNIZED_UA_REASON); - return true; + return false; } if (blockedVersionsByPlatform.containsKey(userAgent.platform())) { diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilterTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilterTest.java index 2617ac15c..f15e3f371 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilterTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilterTest.java @@ -111,8 +111,7 @@ class RemoteDeprecationFilterTest { minimumVersionsByPlatform, versionsPendingDeprecationByPlatform, blockedVersionsByPlatform, - versionsPendingBlockByPlatform, - true); + versionsPendingBlockByPlatform); } @ParameterizedTest