Add initial support for backup and restore of message and media to staging.

Co-authored-by: Cody Henthorne <cody@signal.org>
This commit is contained in:
Clark
2024-04-12 11:57:34 -04:00
committed by Greyson Parrelli
parent 8617a074ad
commit 689eacd618
71 changed files with 3198 additions and 744 deletions

View File

@@ -381,6 +381,7 @@ message MessageAttachment {
FilePointer pointer = 1;
Flag flag = 2;
bool wasDownloaded = 3;
}
message FilePointer {
@@ -388,6 +389,9 @@ message FilePointer {
message BackupLocator {
string mediaName = 1;
uint32 cdnNumber = 2;
bytes key = 3;
bytes digest = 4;
uint32 size = 5;
}
// References attachments in the transit storage tier.
@@ -398,37 +402,33 @@ message FilePointer {
string cdnKey = 1;
uint32 cdnNumber = 2;
uint64 uploadTimestamp = 3;
bytes key = 4;
bytes digest = 5;
uint32 size = 6;
}
// An attachment that was copied from the transit storage tier
// to the backup (media) storage tier up without being downloaded.
// Its MediaName should be generated as “{sender_aci}_{cdn_attachment_key}”,
// but should eventually transition to a BackupLocator with mediaName
// being the content hash once it is downloaded.
message UndownloadedBackupLocator {
bytes senderAci = 1;
string cdnKey = 2;
uint32 cdnNumber = 3;
// References attachments that are invalid in such a way where download
// cannot be attempted. Could range from missing digests to missing
// CDN keys or anything else that makes download attempts impossible.
// This serves as a 'tombstone' so that the UX can show that an attachment
// did exist, but for whatever reason it's not retrievable.
message InvalidAttachmentLocator {
}
oneof locator {
BackupLocator backupLocator = 1;
AttachmentLocator attachmentLocator= 2;
UndownloadedBackupLocator undownloadedBackupLocator = 3;
InvalidAttachmentLocator invalidAttachmentLocator = 3;
}
optional bytes key = 5;
optional string contentType = 6;
// Size of fullsize decrypted media blob in bytes.
// Can be ignored if unset/unavailable.
optional uint32 size = 7;
optional bytes incrementalMac = 8;
optional uint32 incrementalMacChunkSize = 9;
optional string fileName = 10;
optional uint32 width = 11;
optional uint32 height = 12;
optional string caption = 13;
optional string blurHash = 14;
optional string contentType = 4;
optional bytes incrementalMac = 5;
optional uint32 incrementalMacChunkSize = 6;
optional string fileName = 7;
optional uint32 width = 8;
optional uint32 height = 9;
optional string caption = 10;
optional string blurHash = 11;
}
message Quote {

View File

@@ -46,4 +46,8 @@ message AttachmentUploadJobData {
message PreKeysSyncJobData {
bool forceRefreshRequested = 1;
}
message ArchiveAttachmentJobData {
uint64 attachmentId = 1;
}