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)
Fri, Dec 13, 11:57 PM
Unknown Object (File)
Wed, Dec 11, 7:46 PM
Unknown Object (File)
Tue, Nov 26, 4:19 PM
Unknown Object (File)
Tue, Nov 26, 3:56 PM
Unknown Object (File)
Tue, Nov 26, 10:07 AM
Unknown Object (File)
Nov 14 2024, 10:07 PM
Unknown Object (File)
Nov 8 2024, 10:03 PM
Unknown Object (File)
Nov 8 2024, 7:15 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

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
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