HomePhabricator
Diffusion Comm 88c7e28b9913

[lib] Remove usernames sent by the keyserver and use reservedUserIdentifiers

Description

[lib] Remove usernames sent by the keyserver and use reservedUserIdentifiers

Summary:
@bartek updated identityClient.findUserIdentities to also return reservedUserIdentifiers - usernames of users not registered with identity, but registered with the keyserver. This means we can go back to stripping usernames from responses sent by the keyserver and request them from identity. This will now work for all users.
This diff addresses ENG-8771. It reverts D12674 with the following changes:

  1. In discardKeyserverUsernames we no longer check if id === bots.commbot.userID. This is because commbot is in reservedUserIdentifiers both on stagining and prod
  2. In discardKeyserverUsernames we check if usingCommServicesAccessToken. If not, we return the userInfos unchanged. This is because we cannot call the identity if there is no CSAT, so we need to keep the keyserver usernames

Test Plan:
Tested that commbots username gets fetched (was seting with staging identity, because prod identity doesn't yet have Bartek's changes. I verified that prod identity also has commot in reservedUserIdentifiers).
Tested that usernames of users registered with identity still get fetched.

Verified that for a user with usingCSAT = false the usernames are not missing. Verified that usernames of users registered with usingCSAT = false are also present

Reviewers: tomek, bartek

Reviewed By: tomek, bartek

Subscribers: ashoat, bartek

Differential Revision: https://phab.comm.dev/D12952

Details