HomePhabricator
Diffusion Comm 3023e165ac6c

[lib] Introduce `MinimallyEncodedRoleInfo` and validator

Description

[lib] Introduce MinimallyEncodedRoleInfo and validator

Summary:
RoleInfo type with permissions as $ReadOnlyArray<string> instead of ThreadRolePermissionsBlob.

Next diffs:

  • Introduce MinimallyEncodedThreadCurrentUserInfo
  • Introduce MinimallyEncodedRawThreadInfo
  • Higher level utilities for translating back/forth from RawThreadInfo <=> MinimallyEncodedRawThreadInfo. Found this to be cleaner API than encoding/decoding RawThreadInfo.currentUser.permissions and RawThreadInfo.members[memberID].permissions "manually" a bunch of different places.
  • Native refactoring + migrations
  • Web refactoring
  • Flipping the switch

Test Plan: Added some unit tests, will consume types in subsequent diffs.

Reviewers: ashoat, ginsu, tomek, rohan

Reviewed By: ashoat

Subscribers: wyilio

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

Details

Provenance
atulAuthored on Nov 6 2023, 11:59 AM
Reviewer
ashoat
Differential Revision
D9731: [lib] Introduce `MinimallyEncodedRoleInfo` and validator
Parents
rCOMM2d42d3a7d528: [lib] Update staff.js
Branches
Unknown
Tags
Unknown