mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 05:46:47 +00:00
Update exception for empty non-sync messages to MessageSender
This commit is contained in:
1 parent
b702d9d5a9
commit
aabbbe486f
2 files changed
+5
-2
No files matched your search
@@ -304,8 +304,11 @@ public class MessageSender {
|
||||
}
|
||||
|
||||
if (messagesByDeviceId.isEmpty()) {
|
||||
if (syncMessageSenderDeviceId.isEmpty()) {
|
||||
throw new IllegalArgumentException("Messages must not be empty for non-sync messages");
|
||||
}
|
||||
Metrics.counter(EMPTY_MESSAGE_LIST_COUNTER_NAME,
|
||||
Tags.of(SYNC_MESSAGE_TAG_NAME, String.valueOf(syncMessageSenderDeviceId.isPresent())).and(platformTag)).increment();
|
||||
Tags.of(SYNC_MESSAGE_TAG_NAME, String.valueOf(true)).and(platformTag)).increment();
|
||||
}
|
||||
|
||||
final byte excludedDeviceId;
|
||||
|
||||
@@ -576,7 +576,7 @@ class MessageSenderTest {
|
||||
when(account.getDevices()).thenReturn(List.of(device));
|
||||
when(account.isIdentifiedBy(serviceIdentifier)).thenReturn(true);
|
||||
|
||||
assertThrows(MismatchedDevicesException.class, () -> messageSender.sendMessages(account,
|
||||
assertThrows(IllegalArgumentException.class, () -> messageSender.sendMessages(account,
|
||||
serviceIdentifier,
|
||||
Collections.emptyMap(),
|
||||
Collections.emptyMap(),
|
||||
|
||||
Reference in new issue
Block a user