[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:
Logged result of function after and observed ABSENCE of specialRole:
Reviewers: ginsu, tomek
Reviewed By: tomek
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D10990