-
Notifications
You must be signed in to change notification settings - Fork 29
feat: port store messages command to Rust #1234
Conversation
9d9c0e9
to
6cebabc
Compare
Codecov Report
@@ Coverage Diff @@
## master #1234 +/- ##
======================================
Coverage 100% 100%
======================================
Files 60 60
Lines 10198 10211 +13
======================================
+ Hits 10198 10211 +13
Continue to review full report at Codecov.
|
autopush_rs/src/util/ddb_helpers.rs
Outdated
fn from(val: HashMap<String, String>) -> NotificationHeaders { | ||
NotificationHeaders { | ||
crypto_key: val.get("crypto_key").map(|v| v.to_string()), | ||
encryption: val.get("encrypption").map(|v| v.to_string()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"encryption"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, not sure what the impact of setting these to the string "None" might be. Might be better to set them to an empty string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They won't be included if they're None, as the serde tag says to skip serializing them in that case.
6c6066a
to
824ea78
Compare
autopush_rs/src/util/ddb_helpers.rs
Outdated
delete_request: None, | ||
}) | ||
.collect(); | ||
let mut request_items = HashMap::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could replace this w/ hashmap! and put it 3 lines down
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can? hashmap! makes a different structure than I want here though.
autopush_rs/src/util/ddb_helpers.rs
Outdated
let sort_key = val.sort_key(); | ||
let uaid = val.uaid | ||
.map(|v| Uuid::parse_str(&v)) | ||
.expect("Invalid UAID found")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surely you meant an ok_or(..)? here
autopush_rs/src/util/ddb_helpers.rs
Outdated
|err: &BatchWriteItemError| { | ||
matches!(err, &BatchWriteItemError::ProvisionedThroughputExceeded(_)) | ||
}, | ||
).and_then(|_| Box::new(future::ok(()))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a newline here in between )
and .
I wonder if this is a cargo fmt bug, map/chain_err below should really aline w/ and_then (this made me think this was a bug for a second). delete_message has a similar one
a83cfc6
to
f7248d0
Compare
Add's Rust integration test to verify the direct message is stored that was not present before. Closes #1208
Add's Rust integration test to verify the direct message is stored that
was not present before.
Closes #1208