mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 23:58:06 +01:00
Include client version in the large message counter tags
This commit is contained in:
committed by
Jon Chambers
parent
e1c901c5cf
commit
3ac7a41f9b
@@ -48,6 +48,7 @@ import org.whispersystems.textsecuregcm.identity.PniServiceIdentifier;
|
||||
import org.whispersystems.textsecuregcm.identity.ServiceIdentifier;
|
||||
import org.whispersystems.textsecuregcm.metrics.UserAgentTagUtil;
|
||||
import org.whispersystems.textsecuregcm.storage.Account;
|
||||
import org.whispersystems.textsecuregcm.storage.ClientReleaseManager;
|
||||
import org.whispersystems.textsecuregcm.storage.Device;
|
||||
import org.whispersystems.textsecuregcm.storage.MessagesManager;
|
||||
import org.whispersystems.textsecuregcm.tests.util.MultiRecipientMessageHelper;
|
||||
@@ -65,7 +66,7 @@ class MessageSenderTest {
|
||||
messagesManager = mock(MessagesManager.class);
|
||||
pushNotificationManager = mock(PushNotificationManager.class);
|
||||
|
||||
messageSender = new MessageSender(messagesManager, pushNotificationManager);
|
||||
messageSender = new MessageSender(messagesManager, pushNotificationManager, mock(ClientReleaseManager.class));
|
||||
}
|
||||
|
||||
|
||||
@@ -275,7 +276,8 @@ class MessageSenderTest {
|
||||
messagesByDeviceId,
|
||||
registrationIdsByDeviceId,
|
||||
syncMessageSenderDeviceId,
|
||||
"Signal/Test");
|
||||
"Signal/Test",
|
||||
mock(ClientReleaseManager.class));
|
||||
|
||||
if (expectedExceptionClass != null) {
|
||||
assertThrows(expectedExceptionClass, validateIndividualMessageBundle);
|
||||
@@ -434,10 +436,10 @@ class MessageSenderTest {
|
||||
@Test
|
||||
void validateContentLength() {
|
||||
assertThrows(MessageTooLargeException.class, () ->
|
||||
MessageSender.validateContentLength(MessageSender.MAX_MESSAGE_SIZE + 1, false, false, false, Tag.of(UserAgentTagUtil.PLATFORM_TAG, "test")));
|
||||
MessageSender.validateContentLength(MessageSender.MAX_MESSAGE_SIZE + 1, false, false, false, Tag.of(UserAgentTagUtil.PLATFORM_TAG, "test"), Optional.empty()));
|
||||
|
||||
assertDoesNotThrow(() ->
|
||||
MessageSender.validateContentLength(MessageSender.MAX_MESSAGE_SIZE, false, false, false, Tag.of(UserAgentTagUtil.PLATFORM_TAG, "test")));
|
||||
MessageSender.validateContentLength(MessageSender.MAX_MESSAGE_SIZE, false, false, false, Tag.of(UserAgentTagUtil.PLATFORM_TAG, "test"), Optional.empty()));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ChangeNumberManagerTest {
|
||||
void setUp() throws Exception {
|
||||
accountsManager = mock(AccountsManager.class);
|
||||
messageSender = mock(MessageSender.class);
|
||||
changeNumberManager = new ChangeNumberManager(messageSender, accountsManager, CLOCK);
|
||||
changeNumberManager = new ChangeNumberManager(messageSender, accountsManager, mock(ClientReleaseManager.class), CLOCK);
|
||||
|
||||
updatedPhoneNumberIdentifiersByAccount = new HashMap<>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user