mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 07:16:47 +00:00
Handle cases where a message might be missing a destination UUID
This commit is contained in:
1 parent
62aa0cef39
commit
9c62622733
1 file changed
+7
-2
+7
-2
@@ -86,8 +86,13 @@ public class MessagesDynamoDb extends AbstractDynamoDbStore {
|
||||
.put(LOCAL_INDEX_MESSAGE_UUID_KEY_SORT, convertLocalIndexMessageUuidSortKey(messageUuid))
|
||||
.put(KEY_TYPE, AttributeValues.fromInt(message.getType().getNumber()))
|
||||
.put(KEY_TIMESTAMP, AttributeValues.fromLong(message.getTimestamp()))
|
||||
.put(KEY_TTL, AttributeValues.fromLong(getTtlForMessage(message)))
|
||||
.put(KEY_DESTINATION_UUID, AttributeValues.fromUUID(UUID.fromString(message.getDestinationUuid())));
|
||||
.put(KEY_TTL, AttributeValues.fromLong(getTtlForMessage(message)));
|
||||
|
||||
// TODO All messages should have a destination UUID by 2021-12-03, and this can be set unconditionally
|
||||
if (message.hasDestinationUuid()) {
|
||||
item.put(KEY_DESTINATION_UUID, AttributeValues.fromUUID(UUID.fromString(message.getDestinationUuid())));
|
||||
}
|
||||
|
||||
if (message.hasRelay() && message.getRelay().length() > 0) {
|
||||
item.put(KEY_RELAY, AttributeValues.fromString(message.getRelay()));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user