From 0eb7db8de5e46a1ca73d1797ae141c560308ae52 Mon Sep 17 00:00:00 2001 From: Ravi Khadiwala Date: Tue, 1 Oct 2024 16:55:34 -0500 Subject: [PATCH] Increase the linked device idle timeout to 45 days --- .../java/org/whispersystems/textsecuregcm/storage/Device.java | 2 +- .../org/whispersystems/textsecuregcm/storage/DeviceTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/Device.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/Device.java index ed83fd965..4b6387c67 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/Device.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/Device.java @@ -25,7 +25,7 @@ public class Device { public static final List ALL_POSSIBLE_DEVICE_IDS = IntStream.range(Device.PRIMARY_ID, MAXIMUM_DEVICE_ID).boxed() .map(Integer::byteValue).collect(Collectors.toList()); - private static final long ALLOWED_LINKED_IDLE_MILLIS = Duration.ofDays(30).toMillis(); + private static final long ALLOWED_LINKED_IDLE_MILLIS = Duration.ofDays(45).toMillis(); private static final long ALLOWED_PRIMARY_IDLE_MILLIS = Duration.ofDays(180).toMillis(); @JsonDeserialize(using = DeviceIdDeserializer.class) diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/DeviceTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/DeviceTest.java index af32761ac..ca0aa849b 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/DeviceTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/DeviceTest.java @@ -22,8 +22,8 @@ class DeviceTest { "true, P180D, false", "true, P181D, true", "false, P1D, false", - "false, P30D, false", - "false, P31D, true", + "false, P45D, false", + "false, P46D, true", "false, P180D, true", }) public void testIsExpired(final boolean primary, final Duration timeSinceLastSeen, final boolean expectExpired) {