While working on ENG-8292, I learned that my username is included for every single thread in GENESIS. That means if you type in my name in ThreadPickerModal, nothing at all is filtered.
useThreadSearchIndex is used in several places, so I did a more thorough analysis:
- useThreadListSearch, which is used for the search bar that appears over the thread list on the home page. However in this case, the results are passed through getThreadListSearchResults, which reorders them for relevancy. So the impact is not as bad.
- useSearchSubchannels and useSearchSidebars, which are used in SubchannelsListModal and SidebarListModal on native. In this case we're using ThreadInfos instead of RawThreadInfos, and threadInfoFromRawThreadInfo filters out members without roles by calling getRelativeMemberInfos, which filters them here. This means the keyserver admin is never included unless they are actually listed as a member of the thread.
- useFilteredChildThreads, which is used in SidebarsModal and SubchannelsModal on web. Similar case as above: we use ThreadInfos, so there is no problem.
- Finally, the case in the Linear task: ThreadPickerModal on both native and web. We use RawThreadInfos here, and do not sort the results after we received them.
This diff makes it so we don't include the keyserver admin's username as a match for every channel in ThreadPickerModal or in useThreadListSearch. The other two are not affected since they use ThreadInfo instead of RawThreadInfo.