Page MenuHomePhabricator

[keyserver] Update `fetchServerThreadInfos(filter?: FetchThreadInfosFilter)` to fetch special_role
ClosedPublic

Authored by atul on Nov 30 2023, 1:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 10:07 PM
Unknown Object (File)
Fri, Nov 8, 10:03 PM
Unknown Object (File)
Fri, Nov 8, 7:15 PM
Unknown Object (File)
Fri, Nov 8, 7:15 PM
Unknown Object (File)
Fri, Nov 8, 7:15 PM
Unknown Object (File)
Fri, Nov 8, 7:15 PM
Unknown Object (File)
Fri, Nov 8, 7:15 PM
Unknown Object (File)
Fri, Nov 8, 1:36 PM
Subscribers

Details

Summary

We want to update code that fetches from threads or roles to appropriately also fetch roles.special_role so we can include it in the return object. For now, I will leave in the r.special_role = ${specialRoles.DEFAULT_ROLE} AS is_default since I'm intermediately leaving in the isDefault property in RoleInfo. Towards the end of the stack, I will remove this check alongside the property as mentioned in the Linear task.

Part of ENG-5993

This diff handles thread.fetchers.js

Depends on D10106

Test Plan

Ran the query before and after to confirm the results are identical, except with the new special_role field

Diff Detail

Repository
rCOMM Comm
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

rohan held this revision as a draft.
rohan published this revision for review.Nov 30 2023, 1:33 PM
This revision is now accepted and ready to land.Dec 1 2023, 7:54 AM
atul edited reviewers, added: rohan; removed: atul.
atul requested review of this revision.Feb 6 2024, 11:55 AM
atul retitled this revision from [keyserver] Update thread-fetchers to fetch special_role to [keyserver] Update `fetchServerThreadInfos(filter?: FetchThreadInfosFilter)` to fetch special_role.
keyserver/src/fetchers/thread-fetchers.js
237 ↗(On Diff #36727)

Explicitly annotated to handle flow limitation described here: https://linear.app/comm/issue/ENG-6596/investigate-why-flow-didnt-detect-issue-with-creatependingthread

Otherwise I could put in whatever:

370b46.png (588×1 px, 102 KB)

lib/types/thread-types.js
160 ↗(On Diff #36727)
NOTE: Updated ServerThreadInfo here to have each role be ServerLegacyRoleInfo instead of ClientLegacyRoleInfo.

Will handle stripping out/keeping of specialRole field in rawThreadInfoFromServerThreadInfo based on codeVersion checks.

NOTE: This diff is NOT safe to land (validators will fail) until we make corresponding updates to rawThreadInfoFromServerThreadInfo.
NOTE: This is safe to land after D10990 (will land them at the same time)
This revision is now accepted and ready to land.Feb 8 2024, 2:14 AM