Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3335839
D11713.id39350.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D11713.id39350.diff
View Options
diff --git a/services/backup/src/constants.rs b/services/backup/src/constants.rs
--- a/services/backup/src/constants.rs
+++ b/services/backup/src/constants.rs
@@ -27,6 +27,7 @@
pub const USER_DATA: &str = "userData";
pub const USER_KEYS: &str = "userKeys";
pub const ATTACHMENTS: &str = "attachments";
+ pub const MSG_BACKUP: &str = "msgBackup";
}
}
diff --git a/services/backup/src/database/backup_item.rs b/services/backup/src/database/backup_item.rs
--- a/services/backup/src/database/backup_item.rs
+++ b/services/backup/src/database/backup_item.rs
@@ -15,6 +15,7 @@
pub user_keys: BlobInfo,
pub user_data: BlobInfo,
pub attachments: Vec<BlobInfo>,
+ pub msg_backup: Option<String>,
}
impl BackupItem {
@@ -24,6 +25,7 @@
user_keys: BlobInfo,
user_data: BlobInfo,
attachments: Vec<BlobInfo>,
+ msg_backup: Option<String>,
) -> Self {
BackupItem {
user_id,
@@ -32,6 +34,7 @@
user_keys,
user_data,
attachments,
+ msg_backup,
}
}
@@ -109,6 +112,12 @@
);
}
+ if let Some(msg_backup_value) = value.msg_backup {
+ attrs.insert(
+ backup_table::attr::MSG_BACKUP.to_string(),
+ AttributeValue::S(msg_backup_value),
+ );
+ }
attrs
}
}
@@ -148,6 +157,16 @@
Vec::new()
};
+ let msg_backup = value.remove(backup_table::attr::MSG_BACKUP);
+ let msg_backup = if msg_backup.is_some() {
+ Some(String::try_from_attr(
+ backup_table::attr::MSG_BACKUP,
+ msg_backup,
+ )?)
+ } else {
+ None
+ };
+
Ok(BackupItem {
user_id,
backup_id,
@@ -155,6 +174,7 @@
user_keys,
user_data,
attachments,
+ msg_backup,
})
}
}
@@ -195,6 +215,7 @@
Ok(OrderedBackupItem {
user_id,
+
created,
backup_id,
user_keys,
diff --git a/services/backup/src/http/handlers/backup.rs b/services/backup/src/http/handlers/backup.rs
--- a/services/backup/src/http/handlers/backup.rs
+++ b/services/backup/src/http/handlers/backup.rs
@@ -76,12 +76,25 @@
attachments_revokes.push(revoke);
}
+ let msg_backup_option: Option<String> =
+ match get_text_field(&mut multipart).await.unwrap() {
+ Some((name, msg_backup)) => {
+ if name == "msg_backup" {
+ Some(msg_backup)
+ } else {
+ None
+ }
+ }
+ _ => None,
+ };
+
let item = BackupItem::new(
user.user_id.clone(),
backup_id,
user_keys_blob_info,
user_data_blob_info,
attachments,
+ msg_backup_option,
);
db_client
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 11:20 AM (17 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2561335
Default Alt Text
D11713.id39350.diff (2 KB)
Attached To
Mode
D11713: Introduce msg_backup field to BackupItem
Attached
Detach File
Event Timeline
Log In to Comment