Skip to content

Commit

Permalink
Fix setting the UAID in DbClient::update_user
Browse files Browse the repository at this point in the history
It is an error to try and set the primary key of a row via UpdateItem.
  • Loading branch information
AzureMarker committed Jul 17, 2020
1 parent e0c96a4 commit 31432be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autoendpoint/src/db/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ impl DbClient {
/// already exist, has a different router type, or has a newer
/// `connected_at` timestamp.
pub async fn update_user(&self, user: &DynamoDbUser) -> DbResult<()> {
let user_map = serde_dynamodb::to_hashmap(&user)?;
let mut user_map = serde_dynamodb::to_hashmap(&user)?;
user_map.remove("uaid");
let input = UpdateItemInput {
table_name: self.router_table.clone(),
key: ddb_item! { uaid: s => user.uaid.to_simple().to_string() },
Expand Down

0 comments on commit 31432be

Please sign in to comment.