From 60ab00ecc64e63af3418f93d7b3dcfd95428cb39 Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Wed, 9 Apr 2025 09:41:20 -0400 Subject: [PATCH] Specify bounds for message timestamps --- .../src/main/proto/org/signal/chat/messages.proto | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/service/src/main/proto/org/signal/chat/messages.proto b/service/src/main/proto/org/signal/chat/messages.proto index a34e42ab8..69baeb8f8 100644 --- a/service/src/main/proto/org/signal/chat/messages.proto +++ b/service/src/main/proto/org/signal/chat/messages.proto @@ -142,9 +142,12 @@ message IndividualRecipientMessageBundle { /** * The time, in milliseconds since the epoch, at which this message was - * originally sent from the perspective of the sender. + * originally sent from the perspective of the sender. Note that the maximum + * allowable timestamp for JavaScript clients is less than Long.MAX_VALUE; see + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date + * for additional details and discussion. */ - uint64 timestamp = 1; + uint64 timestamp = 1 [(require.range).min = 1, (require.range).max = 8640000000000000]; /** * A map of device IDs to individual messages. Generally, callers must include @@ -327,9 +330,12 @@ message MultiRecipientMessage { /** * The time, in milliseconds since the epoch, at which this message was - * originally sent from the perspective of the sender. + * originally sent from the perspective of the sender. Note that the maximum + * allowable timestamp for JavaScript clients is less than Long.MAX_VALUE; see + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date + * for additional details and discussion. */ - uint64 timestamp = 1; + uint64 timestamp = 1 [(require.range).min = 1, (require.range).max = 8640000000000000]; /** * The serialized multi-recipient message payload.