mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-02 09:42:48 +01:00
Prohibit pre-set message GUIDs when inserting into FoundationDB
This commit is contained in:
committed by
Jon Chambers
parent
844e103c86
commit
d2cbdd4609
@@ -103,6 +103,14 @@ public class FoundationDbMessageStore {
|
||||
throw new IllegalArgumentException("One or more message bundles is empty");
|
||||
}
|
||||
|
||||
if (messagesByServiceIdentifier.values()
|
||||
.stream()
|
||||
.flatMap(messages -> messages.values().stream())
|
||||
.anyMatch(MessageProtos.Envelope::hasServerGuid)) {
|
||||
|
||||
throw new IllegalArgumentException("Messages must not have pre-set server GUIDs");
|
||||
}
|
||||
|
||||
final Map<Integer, List<Map.Entry<AciServiceIdentifier, Map<Byte, MessageProtos.Envelope>>>> messagesByShardId =
|
||||
messagesByServiceIdentifier.entrySet().stream()
|
||||
.collect(Collectors.groupingBy(entry -> hashAciToShardNumber(entry.getKey())));
|
||||
|
||||
Reference in New Issue
Block a user