Page MenuHomePhabricator

Introduce msg_backup field to BackupItem
AcceptedPublic

Authored by marcin on Mon, Apr 22, 11:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 3, 1:31 AM
Unknown Object (File)
Wed, May 1, 5:48 PM
Unknown Object (File)
Tue, Apr 30, 7:36 PM
Unknown Object (File)
Sun, Apr 28, 10:57 PM
Unknown Object (File)
Sun, Apr 28, 6:21 PM
Unknown Object (File)
Fri, Apr 26, 8:04 PM
Unknown Object (File)
Tue, Apr 23, 1:50 AM
Unknown Object (File)
Tue, Apr 23, 1:50 AM
Subscribers

Details

Reviewers
bartek
kamil
Summary

This differential introduces new field - msg_backup to BackupItem so that backup data can be persisted in dynamodb with respective backup message.

Test Plan
  1. Locally trigger backup upload from password user.
  2. Ensure that it works and using web inspector of dynamodb see that there is a new column with undefined value.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Mostly looks good. Left a few suggestions

services/backup/src/constants.rs
30 ↗(On Diff #39356)

I'd prefer naming this siwe_backup_message / siweBackupMessage / SIWE_BACKUP_MSG

services/backup/src/database/backup_item.rs
160–168 ↗(On Diff #39356)

This should work too.

Or even simpler:

// top of the file
use comm_lib::database::AttributeExtractor;

// then you can
let msg_backup: Option<String> = value.take_attr(backup_table::attr::MSG_BACKUP)?;
services/backup/src/http/handlers/backup.rs
80 ↗(On Diff #39356)

Shouldn't we catch errors the same way we're doing e.g. for the "attachments" text field above?

This revision is now accepted and ready to land.Mon, Apr 22, 11:38 PM
kamil added inline comments.
services/backup/src/constants.rs
30 ↗(On Diff #39356)

agree with that

  1. Simplify code
  2. rename msg_backup to siwe_backup_msg