From 159e1f13f0622da4fe859d8a7049b29b13ab7def Mon Sep 17 00:00:00 2001 From: Ravi Khadiwala Date: Thu, 29 Jan 2026 14:43:28 -0600 Subject: [PATCH] Fix credential age calculation --- .../controllers/SecureValueRecovery2Controller.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2Controller.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2Controller.java index 2227c5bfa..c47242900 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2Controller.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2Controller.java @@ -142,7 +142,7 @@ public class SecureValueRecovery2Controller { .baseUnit("days") .tags(Tags.of(UserAgentTagUtil.getPlatformTag(userAgent), Tag.of("valid", Boolean.toString(info.valid())))) .register(Metrics.globalRegistry) - .record(Duration.between(Instant.ofEpochMilli(info.timestamp()), Instant.now()).toDays())); + .record(Duration.between(Instant.ofEpochSecond(info.timestamp()), Instant.now()).toDays())); return new AuthCheckResponseV2(credentials.stream().collect(Collectors.toMap( ExternalServiceCredentialsSelector.CredentialInfo::token,