Page MenuHomePhabricator

Introduce msg_backup field to BackupItem
ClosedPublic

Authored by marcin on Apr 22 2024, 11:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 21, 11:37 AM
Unknown Object (File)
Thu, Nov 21, 11:37 AM
Unknown Object (File)
Thu, Nov 21, 11:34 AM
Unknown Object (File)
Thu, Nov 21, 11:21 AM
Unknown Object (File)
Thu, Nov 21, 11:20 AM
Unknown Object (File)
Thu, Nov 21, 7:33 AM
Unknown Object (File)
Sat, Nov 9, 3:03 PM
Unknown Object (File)
Sat, Nov 9, 4:51 AM
Subscribers

Details

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

I'd prefer naming this siwe_backup_message / siweBackupMessage / SIWE_BACKUP_MSG

services/backup/src/database/backup_item.rs
160–168

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

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.Apr 22 2024, 11:38 PM
kamil added inline comments.
services/backup/src/constants.rs
30

agree with that

  1. Simplify code
  2. rename msg_backup to siwe_backup_msg
This revision was automatically updated to reflect the committed changes.