Page MenuHomePhabricator

[identity] Add function to add new device to the list
ClosedPublic

Authored by bartek on Dec 7 2023, 12:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 17, 11:40 PM
Unknown Object (File)
Sat, Nov 16, 4:47 PM
Unknown Object (File)
Fri, Nov 15, 8:23 PM
Unknown Object (File)
Thu, Nov 7, 12:17 AM
Unknown Object (File)
Oct 18 2024, 4:14 AM
Unknown Object (File)
Oct 18 2024, 4:14 AM
Unknown Object (File)
Oct 18 2024, 4:14 AM
Unknown Object (File)
Oct 18 2024, 4:14 AM
Subscribers

Details

Summary

Added a function that transactionally adds a new device to the device list and generate a new devicelist version. Details in D10219 where I used simplified version of this diff as a test plan.

Depends on D10219

Test Plan

Actually this function is extended version of the function in D10219 test plan. Test plans overlap, I just tested one more scenario:

  • Called this function twice - first one succeeded, second one failed with error message "Device already exists"

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Dec 7 2023, 1:07 AM
bartek added inline comments.
services/identity/src/database/device_list.rs
73–74 ↗(On Diff #34370)

Both DeviceTypes refer the same enum in proto, but one is in the grpc_clients crate (client-specific) while the other is in Identity directly. They're exactly the same but to the compiler they are different structs.
Decided to panic here because this happens only when the crate is badly compiled.

Move function into impl DatabaseClient.

This revision is now accepted and ready to land.Dec 13 2023, 6:07 PM