Skip to content

Commit

Permalink
Update Backup.proto and fix test cases
Browse files Browse the repository at this point in the history
- Group snapshots no longer contain a publicKey
  • Loading branch information
jrose-signal committed Aug 12, 2024
1 parent 57f6f4b commit 86b1c8f
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 20 deletions.
70 changes: 51 additions & 19 deletions Backup.proto
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ message Group {
// We would use Groups.proto if we could, but we want a plaintext version to improve export readability.
// For documentation, defer to Groups.proto. The only name change is Group -> GroupSnapshot to avoid the naming conflict.
message GroupSnapshot {
bytes publicKey = 1;
reserved /*publicKey*/ 1; // The field is deprecated in the context of static group state
GroupAttributeBlob title = 2;
GroupAttributeBlob description = 11;
string avatarUrl = 3;
Expand Down Expand Up @@ -343,23 +343,49 @@ message ChatItem {
}

message SendStatus {
enum Status {
UNKNOWN = 0;
FAILED = 1;
PENDING = 2;
SENT = 3;
DELIVERED = 4;
READ = 5;
VIEWED = 6;
SKIPPED = 7; // e.g. user in group was blocked, so we skipped sending to them
message Pending {}

message Sent {
bool sealedSender = 1;
}

message Delivered {
bool sealedSender = 1;
}

message Read {
bool sealedSender = 1;
}

message Viewed {
bool sealedSender = 1;
}

// e.g. user in group was blocked, so we skipped sending to them
message Skipped {}

message Failed {
enum FailureReason {
UNKNOWN = 0; // A valid value -- could indicate a crash or lack of information
NETWORK = 1;
IDENTITY_KEY_MISMATCH = 2;
}

FailureReason reason = 1;
}

uint64 recipientId = 1;
Status deliveryStatus = 2;
bool networkFailure = 3;
bool identityKeyMismatch = 4;
bool sealedSender = 5;
uint64 lastStatusUpdateTimestamp = 6; // the time the status was last updated -- if from a receipt, it should be the sentTime of the receipt
uint64 timestamp = 2; // the time the status was last updated -- if from a receipt, it should be the sentTime of the receipt

oneof deliveryStatus {
Pending pending = 3;
Sent sent = 4;
Delivered delivered = 5;
Read read = 6;
Viewed viewed = 7;
Skipped skipped = 8;
Failed failed = 9;
}
}

message Text {
Expand Down Expand Up @@ -565,7 +591,7 @@ message FilePointer {
optional uint32 cdnNumber = 2;
bytes key = 3;
bytes digest = 4;
uint64 size = 5;
uint32 size = 5;
// Fallback in case backup tier upload failed.
optional string transitCdnKey = 6;
optional uint32 transitCdnNumber = 7;
Expand Down Expand Up @@ -652,8 +678,11 @@ message Reaction {
string emoji = 1;
uint64 authorId = 2;
uint64 sentTimestamp = 3;
// Optional because some clients may not track this data
optional uint64 receivedTimestamp = 4;
uint64 sortOrder = 5; // A higher sort order means that a reaction is more recent
// 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;
}

message ChatUpdateMessage {
Expand Down Expand Up @@ -749,6 +778,9 @@ message SimpleChatUpdate {
PAYMENT_ACTIVATION_REQUEST = 11;
UNSUPPORTED_PROTOCOL_MESSAGE = 12;
REPORTED_SPAM = 13;
BLOCKED = 14;
UNBLOCKED = 15;
MESSAGE_REQUEST_ACCEPTED = 16;
}

Type type = 1;
Expand Down Expand Up @@ -1040,7 +1072,7 @@ message ChatStyle {
}

message CustomChatColor {
uint32 id = 1;
uint64 id = 1;

oneof color {
fixed32 solid = 2;
Expand Down Expand Up @@ -1114,7 +1146,7 @@ message ChatStyle {
BubbleColorPreset bubbleColorPreset = 4;

// See AccountSettings.customChatColors
uint32 customColorId = 5;
uint64 customColorId = 5;
}

bool dimWallpaperInDarkMode = 7;
Expand Down
Binary file modified test-cases/incoming-message-with-edits.binproto
Binary file not shown.
1 change: 0 additions & 1 deletion test-cases/incoming-message-with-edits.jsonproto
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
"hideStory": false,
"storySendMode": "DEFAULT",
"snapshot": {
"publicKey": "S20ABvtyIj/t/9G9YazGoPXB4fiBZ/Q+P2TbCE+bsnY=",
"title": {
"title": "Millenium Falcon Mechanics"
},
Expand Down

0 comments on commit 86b1c8f

Please sign in to comment.