Page MenuHomePhabricator

[lib] Include searchUsers results in getPotentialMemberItems
ClosedPublic

Authored by michal on May 29 2023, 6:04 AM.
Tags
None
Referenced Files
F1440413: D8009.id27739.diff
Thu, Mar 28, 9:53 PM
F1440412: D8009.id27717.diff
Thu, Mar 28, 9:53 PM
F1440411: D8009.id27154.diff
Thu, Mar 28, 9:53 PM
F1440409: D8009.id27392.diff
Thu, Mar 28, 9:53 PM
F1440350: D8009.id.diff
Thu, Mar 28, 9:52 PM
F1440271: D8009.diff
Thu, Mar 28, 9:43 PM
Unknown Object (File)
Feb 18 2024, 12:00 AM
Unknown Object (File)
Feb 17 2024, 11:36 PM
Subscribers

Details

Summary

We will want to include results from user search endpoint in web and native chat composers. This diff adds an option to getPotentialMemberItems to include additional users from the endpoint.

Test Plan

Tested if the user are returned correctly (that are not in user store) are returned correctly

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/shared/search-utils.js
35–42 ↗(On Diff #27154)

At this point we probably should refactor this function to take an object of params instead of a list of them

Looks good but address @ashoat's comment before landing

lib/shared/search-utils.js
120–123 ↗(On Diff #27154)

shouldn't you modify this condition to return true when !containingThreadInfo && !userInfo.relationshipStatus?
(relationshipStatus is not defined for GlobalAccountUserInfo)

This revision is now accepted and ready to land.May 30 2023, 9:41 AM

Change the function to take a object of params, fix

lib/shared/search-utils.js
120–123 ↗(On Diff #27154)

Fair point, not sure why flow is returning an error here (flow playground). In any case this should never happen because GlobalAccountUserInfo will only exist when text !=== '' (there's a search). I've changed it to userInfo?.relationshipStatus.