Page MenuHomePhabricator

[identity] Simplify some calls and conversions
ClosedPublic

Authored by bartek on Jan 18 2024, 4:01 AM.
Tags
None
Referenced Files
F3148257: D10700.diff
Mon, Nov 4, 9:49 AM
Unknown Object (File)
Fri, Oct 18, 3:43 AM
Unknown Object (File)
Fri, Oct 18, 3:43 AM
Unknown Object (File)
Fri, Oct 18, 3:43 AM
Unknown Object (File)
Fri, Oct 18, 3:42 AM
Unknown Object (File)
Fri, Oct 18, 3:42 AM
Unknown Object (File)
Sep 9 2024, 7:24 AM
Unknown Object (File)
Sep 8 2024, 6:47 PM
Subscribers

Details

Summary

Part of ENG-5842.
After removing the old device list attributes, there's a lot of code that can be greatly simplified. This diffs does that.

Depends on D10699

Test Plan

Identity integration tests

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Jan 18 2024, 8:08 AM
bartek added inline comments.
services/identity/src/database.rs
258 ↗(On Diff #35783)

The add_password_user_device_to_users_table() and add_wallet_user_device_to_users_table() were duplicates with social_proof being the only difference

592–598 ↗(On Diff #35783)

Unnecessary intermediate function

924–936 ↗(On Diff #35783)
  • Removed unnecessary intermediate function and getting the whole user item while we only need user_id.

I made a mistake here, there's a missing check which I accidentally committed in the next diff. I'll fix this when rebasing.

if devices_response.is_empty() {
  debug!("No devices found for user {}", user_id);
  return Ok(None);
}

Add missing check that previously was accidentally commited in the next diff

varun added inline comments.
services/identity/src/database/device_list.rs
327 ↗(On Diff #35868)

at some point we should change PreKey to Prekey for consistency

This revision is now accepted and ready to land.Jan 22 2024, 7:42 PM
services/identity/src/database/device_list.rs
327 ↗(On Diff #35868)

Good call, created D10793