From 2485492f713dd06bfb2a05f3802e629e7d3fac89 Mon Sep 17 00:00:00 2001 From: Sasha Weiss Date: Tue, 20 Aug 2024 15:53:20 -0700 Subject: [PATCH] backup: Drop the receivedAtTimestamp field from Reaction --- rust/message-backup/src/backup/chat.rs | 8 -------- rust/message-backup/src/proto/backup.proto | 5 ++--- rust/message-backup/tests/res/Signal-Message-Backup-Tests | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/rust/message-backup/src/backup/chat.rs b/rust/message-backup/src/backup/chat.rs index 06dd5d3ed..016faab6d 100644 --- a/rust/message-backup/src/backup/chat.rs +++ b/rust/message-backup/src/backup/chat.rs @@ -223,7 +223,6 @@ pub struct Reaction { #[serde(bound(serialize = "Recipient: serde::Serialize"))] pub author: Recipient, pub sent_timestamp: Timestamp, - pub received_timestamp: Option, _limit_construction_to_module: (), } @@ -663,7 +662,6 @@ impl> TryFromWith for Re let proto::Reaction { authorId, sentTimestamp, - receivedTimestamp, emoji, sortOrder, special_fields: _, @@ -679,15 +677,12 @@ impl> TryFromWith for Re }; let sent_timestamp = Timestamp::from_millis(sentTimestamp, "Reaction.sentTimestamp"); - let received_timestamp = receivedTimestamp - .map(|timestamp| Timestamp::from_millis(timestamp, "Reaction.receivedTimestamp")); Ok(Self { emoji, sort_order: sortOrder, author, sent_timestamp, - received_timestamp, _limit_construction_to_module: (), }) } @@ -740,7 +735,6 @@ mod test { sortOrder: 3, authorId: proto::Recipient::TEST_ID, sentTimestamp: MillisecondsSinceEpoch::TEST_VALUE.0, - receivedTimestamp: Some(MillisecondsSinceEpoch::TEST_VALUE.0), ..Default::default() } } @@ -753,7 +747,6 @@ mod test { sort_order: 3, author: TestContext::test_recipient().clone(), sent_timestamp: Timestamp::test_value(), - received_timestamp: Some(Timestamp::test_value()), _limit_construction_to_module: (), } } @@ -900,7 +893,6 @@ mod test { |x| x.authorId = proto::Recipient::TEST_ID + 2 => Err(ReactionError::AuthorNotFound(RecipientId(proto::Recipient::TEST_ID + 2))); "invalid_author_id" )] - #[test_case(|x| x.receivedTimestamp = None => Ok(()); "no_received_timestamp")] fn reaction(modifier: fn(&mut proto::Reaction)) -> Result<(), ReactionError> { let mut reaction = proto::Reaction::test_data(); modifier(&mut reaction); diff --git a/rust/message-backup/src/proto/backup.proto b/rust/message-backup/src/proto/backup.proto index 07fa11584..a777f5f39 100644 --- a/rust/message-backup/src/proto/backup.proto +++ b/rust/message-backup/src/proto/backup.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package signal.backup; option java_package = "org.thoughtcrime.securesms.backup.v2.proto"; +option swift_prefix = "BackupProto_"; message BackupInfo { uint64 version = 1; @@ -677,11 +678,9 @@ message Reaction { string emoji = 1; uint64 authorId = 2; uint64 sentTimestamp = 3; - // Optional because some clients may not track this data - optional uint64 receivedTimestamp = 4; // A higher sort order means that a reaction is more recent. Some clients may export this as // incrementing numbers (e.g. 1, 2, 3), others as timestamps. - uint64 sortOrder = 5; + uint64 sortOrder = 4; } message ChatUpdateMessage { diff --git a/rust/message-backup/tests/res/Signal-Message-Backup-Tests b/rust/message-backup/tests/res/Signal-Message-Backup-Tests index d4f615cd0..33e90be18 160000 --- a/rust/message-backup/tests/res/Signal-Message-Backup-Tests +++ b/rust/message-backup/tests/res/Signal-Message-Backup-Tests @@ -1 +1 @@ -Subproject commit d4f615cd057fe9c6f35f2bb1adf19cf18ef1ef47 +Subproject commit 33e90be18b1c73ec653c75bea3aeb2b5f8ef8863