HomePhabricator
Diffusion Comm 552bf09bda6c

Rename `LegacyRoleInfo` to `ClientLegacyRoleInfo`

Description

Rename LegacyRoleInfo to ClientLegacyRoleInfo

Summary:
This is to make room for a ServerLegacyRoleInfo type which will be introduced in the next diff.

The motivation for introducing ServerLegacyRoleInfo is described here: https://phab.comm.dev/D10105#316443

I modified this diff before landing to only modify RoleInfo (formerly MinimallyEncodedRoleInfo) since I figured we could ignore LegacyRoleInfo going forward...

However, as I previously realized and then forgot, we DO need the specialRole field LegacyRoleInfo because on the keyserver we're still constructing Legacy "everything" and then POSSIBLY minimally encoding for new clients. So we'll need specialRole in the LegacyRoleInfo that's being initially constructed so it's available when being converted to RoleInfo.

That said, we will never want a LegacyRoleInfo with specialRole on ANY client because that would lead to issues with validation. So what we'll want to do is:

  1. Introduce ServerLegacyRoleInfo to be used by keyserver to handle fetching from database, etc
  2. Based on codeVersion check either

Old clients: strip out specialRole field to go from ServerLegacyRoleInfo -> ClientLegacyRoleInfo
New clients: minimallyEncode* ServerLegacyRoleInfo -> RoleInfo WHILE RETAINING specialRole field.

Test Plan: This diff is just a straightforward rename. flow and will test validators later in the stack.

Reviewers: ginsu, tomek

Reviewed By: ginsu

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

Details

Provenance
atulAuthored on Feb 7 2024, 12:32 PM
Reviewer
ginsu
Differential Revision
D10968: Rename `LegacyRoleInfo` to `ClientLegacyRoleInfo`
Parents
rCOMM527b6cb428dd: [lib/native] fix @-mentioning in a create new pending GENSIS chat crashes app
Branches
Unknown
Tags
Unknown