mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 16:06:53 +00:00
Store destination UUIDs when persisting messages to DynamoDB
This commit is contained in:
1 parent
394f58f6cc
commit
c5f261305d
3 files changed
+16
-12
No files matched your search
+2
@@ -154,6 +154,7 @@ class MessagePersisterIntegrationTest {
|
||||
.setTimestamp(AttributeValues.getLong(item, "TS", -1))
|
||||
.setServerTimestamp(extractServerTimestamp(AttributeValues.getByteArray(item, "S", null)))
|
||||
.setContent(ByteString.copyFrom(AttributeValues.getByteArray(item, "C", null)))
|
||||
.setDestinationUuid(AttributeValues.getUUID(item, "DU", null).toString())
|
||||
.build());
|
||||
}
|
||||
|
||||
@@ -174,6 +175,7 @@ class MessagePersisterIntegrationTest {
|
||||
.setContent(ByteString.copyFromUtf8(RandomStringUtils.randomAlphanumeric(256)))
|
||||
.setType(MessageProtos.Envelope.Type.CIPHERTEXT)
|
||||
.setServerGuid(messageGuid.toString())
|
||||
.setDestinationUuid(UUID.randomUUID().toString())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
+12
-11
@@ -248,17 +248,18 @@ class WebSocketConnectionIntegrationTest {
|
||||
|
||||
assertTrue(expectedMessages.containsAll(sentMessages));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private MessageProtos.Envelope generateRandomMessage(final UUID messageGuid) {
|
||||
final long timestamp = serialTimestamp++;
|
||||
private MessageProtos.Envelope generateRandomMessage(final UUID messageGuid) {
|
||||
final long timestamp = serialTimestamp++;
|
||||
|
||||
return MessageProtos.Envelope.newBuilder()
|
||||
.setTimestamp(timestamp)
|
||||
.setServerTimestamp(timestamp)
|
||||
.setContent(ByteString.copyFromUtf8(RandomStringUtils.randomAlphanumeric(256)))
|
||||
.setType(MessageProtos.Envelope.Type.CIPHERTEXT)
|
||||
.setServerGuid(messageGuid.toString())
|
||||
.build();
|
||||
}
|
||||
return MessageProtos.Envelope.newBuilder()
|
||||
.setTimestamp(timestamp)
|
||||
.setServerTimestamp(timestamp)
|
||||
.setContent(ByteString.copyFromUtf8(RandomStringUtils.randomAlphanumeric(256)))
|
||||
.setType(MessageProtos.Envelope.Type.CIPHERTEXT)
|
||||
.setServerGuid(messageGuid.toString())
|
||||
.setDestinationUuid(UUID.randomUUID().toString())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user