Page MenuHomePhabricator

Introduce msg_backup field to BackupItem
ClosedPublic

Authored by marcin on Apr 22 2024, 11:17 AM.
Tags
None
Referenced Files
F3334694: D11713.diff
Thu, Nov 21, 7:33 AM
Unknown Object (File)
Sat, Nov 9, 3:03 PM
Unknown Object (File)
Sat, Nov 9, 4:51 AM
Unknown Object (File)
Fri, Nov 8, 8:59 PM
Unknown Object (File)
Thu, Nov 7, 12:23 PM
Unknown Object (File)
Thu, Nov 7, 9:25 AM
Unknown Object (File)
Sun, Nov 3, 6:06 AM
Unknown Object (File)
Sun, Nov 3, 6:06 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 ↗(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.Apr 22 2024, 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
This revision was automatically updated to reflect the committed changes.