Details
Details
- Reviewers
bartek varun - Commits
- rCOMM3e9860bd743d: [Identity] Implement RefreshUserPreKey
Start docker, localstack, and run terraform
cd serivces/commtest cargo test --test identity_prekey_tests # assert prekey was changed awslocal dynamodb scan --table-name identity-users
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Comment Actions
One suggestion, feel free to re-request if I'm wrong or you don't think it's necessary.
The DynamoDB UpdateItem creates the item if it doesn't already exist (source). So if we call db_client.set_prekey() for non-existing user_id, in theory it will create a new db record.
I know that this is called from the RefreshUserPreKeys endpoint which is authenticated so user ID exisrs, but it's good to make the database function bulletproof too - e.g. if it was ever called in any other context.
services/identity/src/database.rs | ||
---|---|---|
245–259 ↗ | (On Diff #28551) | I'd add an expression to make sure this only updates existing records and fails if none exist |
services/identity/src/database.rs | ||
---|---|---|
245–259 ↗ | (On Diff #28551) | Actually I meant attribute_exists() 🤦♂️ Suggested the exact opposite |
Comment Actions
Address feedback
services/identity/src/database.rs | ||
---|---|---|
245–259 ↗ | (On Diff #28551) | Makes a lot of sense, thanks! |