Setting apns push tokens should always update the timestamp

This commit is contained in:
Ravi Khadiwala authored and Jon Chambers committed 2026-07-10 10:46:41 -04:00
1 parent b539df8e48
commit 55fa60dd4e
2 files changed
+7 -2

No files matched your search

@@ -11,6 +11,7 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyByte;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.whispersystems.textsecuregcm.grpc.GrpcTestUtils.assertStatusException;
@@ -334,7 +335,9 @@ class DevicesGrpcServiceTest extends SimpleBaseGrpcTest<DevicesGrpcService, Devi
final SetPushTokenResponse ignored = authenticatedServiceStub().setPushToken(request);
verify(accountsManager, never()).updateDevice(any(), anyByte(), any());
// Update push token even if it matches the stored value for apns (to update the timestamp)
verify(accountsManager, apnsToken == null ? never() : times(1))
.updateDevice(any(), anyByte(), any());
}
private static Stream<Arguments> setPushTokenUnchanged() {