HomePhabricator
Diffusion Comm 3cdfe501d658

[lib] Add `rolesWithoutSpecialRoleField` filter to…

Tags
None
Referenced Files
F1126949: 524c3b.png
Feb 8 2024, 9:39 AM
File Not Attached
F1127043: e817a0.png
Feb 8 2024, 9:39 AM
File Not Attached
Subscribers
None

Description

[lib] Add rolesWithoutSpecialRoleField filter to rawThreadInfoFromServerThreadInfo

Summary:
This is to strip specialRoles out of roles before it's included in the rawThreadInfo: any that's being constructed.

ServerThreadInfo.roles contain specialRole, but RawThreadInfo does not. This change ensures that we construct a properly formed RawThreadInfo.

We will patch the specialRole field back in to minimally encoded RawThreadInfos for future clients (where shouldMinimallyEncodePermissions AND includeSpecialRoleFieldInRoles are true).

This makes D10107 safe to land since as of this diff we're stripping out the specialRole field altogether so there shouldn't be issues with any validators.


Depends on D10975

Test Plan:
Logged result of function before and observed specialRole:

e817a0.png (734×1 px, 208 KB)

Logged result of function after and observed ABSENCE of specialRole:

524c3b.png (606×1 px, 187 KB)

Reviewers: ginsu, tomek

Reviewed By: tomek

Subscribers: ashoat

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