Closed isagoico closed 2 years ago
Triggered auto assignment to @Jag96 (Engineering
), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
prioritizeDefaultRoomsInSearch: false
for getSearchOptions
.
https://github.com/Expensify/App/blob/d2d17181727f2a4d264618986438df2733f107d0/src/libs/OptionsListUtils.js#L581I think Expected behaviour might be more complicated, I guess we should distinguish between the name and description.
Let's consider scenario where we search an
and then we would want the #announce
roome to be first before any person. Here in this case the #announce
room is should because of the limited
in the description.
We should first make sure we have the expected behaviour thought through before making this external. Thoughts about the behaviour @TomatoToaster and @trjExpensify?
From the thread it sounds like we want to prioritize in this order:
Let's consider scenario where we search an and then we would want the #announce room to be first before any person.
All rooms have the #
at the beginning, right? So I'd think if you typed an
you'd want to show results for people first, and if you typed #an
you'd show the room results.
All rooms have the # at the beginning, right? So I'd think if you typed an you'd want to show results for people first, and if you typed #an you'd show the room results.
I agree with that! ๐
Separately, do we need to consider the logic for GroupDMs versus DMs? As in, if you search Ted
, you'd expect to return Ted
first ahead of Ted, Joe
wouldn't you?
@Jag96 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Separately, do we need to consider the logic for GroupDMs versus DMs? As in, if you search
Ted
, you'd expect to returnTed
first ahead ofTed, Joe
wouldn't you?
That makes sense to me ๐
Any other considerations to make here @vitHoracek @trjExpensify? If not we can make this external!
That also seems reasonable to me! I think we settled down on a good solution :)
That was it from my POV at this point! ๐
Triggered auto assignment to @jboniface (External
), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
@parasharrajat I tried testing w/ your proposal and it looks good for single users vs rooms, but it looks like you can still see a group chat above a single user chat. Can you update your proposal so that single users are shown above group chats?
Ok. Great. Based on the expected behaviour https://github.com/Expensify/App/issues/6359#issuecomment-976021754. It can be fixed as follows:
prioritizeDefaultRoomsInSearch: false
for getSearchOptions
.
https://github.com/Expensify/App/blob/d2d17181727f2a4d264618986438df2733f107d0/src/libs/OptionsListUtils.js#L581prioritizeOneToOneReportsInSearch
. mark it true
for getSearchOptions
.
Then add the following code after line OptionsListUtils.js#L510
// If we are prioritizing 1:1 chats in search, do it only once we started searching
if (prioritizeOneToOneReportsInSearch && searchValue !== '') {
const [oneToOneReports, otherReports] = _.partition(recentReportOptions, option => !!option.login);
recentReportOptions = oneToOneReports.concat(otherReports);
}
It will satisfy all three.
@parasharrajat that sounds good to me! @jboniface let's hire @parasharrajat for this one
๐ฃ @parasharrajat You have been assigned to this job by @Jag96! Please apply to this job in Upwork and let us know when we can expect a PR to be ready for review ๐งโ๐ป Keep in mind: Code of Conduct | Contributing ๐
Current assignee @parasharrajat is eligible for the Exported assigner, not assigning anyone new.
Current assignee @Jag96 is eligible for the Exported assigner, not assigning anyone new.
@parasharrajat I created the job and sent an offer!
@parasharrajat I tried testing w/ your proposal and it looks good for single users vs rooms, but it looks like you can still see a group chat above a single user chat. Can you update your proposal so that single users are shown above group chats?
Ah, so one thing here @parasharrajat. I was just chatting to @Jag96, but I think this was the logic for most recent when thereโs a tiebreaker in the DMs match?
As in, if we have Joe
and Joe, Ted
. I just sent a message in Joe, Ted
and I search for Joe
it would show Joe, Ted
before Tom
.
Does everyone agree we should reinstate that if it was removed? If so, happy to add a milestone on to this Upwork contract to account for it ๐
Does everyone agree we should reinstate that if it was removed? If so, happy to add a milestone on to this Upwork contract to account for it ๐
Yup, I forgot about this sorry. I think adding a milestone to the Upwork contract is fine.
Ok. understood but @Jag96 could you please lay down all the update cases once again so that I can decide what to do to cover all?
So the logic should be:
So if I search for Tom
and I haven't chatted w/ Tom
1:1 but we have a group chat, the results would show Tom, Joe, Rajat
first, then Tom
, then any rooms (e.g. #announce). Then, if I chat w/ Tom
in a 1:1 and search Tom
, the 1:1 should show up before the Tom, Joe, Rajat
group, and then the #announce
room would show at the bottom.
@trjExpensify any other additions there?
Prioritize 1:1 chats over group chats based on which chat had the most recent message
Hm, I dunno. I kind of feel like we should always prioritize the DM if only one name has been typed in. Perhaps we can discuss in the #open-source channel to make sure we have agreement on this real quick before going forward.
It has been discussed a few times before I remember (for example here), so I think it'd be good to get some broader visiblity on this decision.
Based on the discussion it sounds like there isn't any additional work to be done here! I will update this GH if anything changes when others come online next week, but for now, we can leave this as is
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.1.18-3 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2021-12-15. :confetti_ball:
Ping for
@jboniface
@parasharrajat sorry this slipped by me, job is here https://www.upwork.com/jobs/~01d07f9c95161deca4 i invited you
Is the search is mapping over the filtered array of objects? If that's the case, wouldn't the following solution work in theory? If it doesn't can you help me understand why?
Each chat object should have
searchOutput
.filter(chat=>!chat.isRoom)
.sort((chatA,chatB)=> chatA.date-chatB.date)
.concat(searchOutput
.filter(chat=>chat.isRoom)
.sort((chatA,chatB)=> chatA.date-chatB.date)
)
Apologies if that's beside the point, still glossing over the codebase
@parasharrajat apologies for the delay here, I hired you, can you accept the offer so I can pay?
@mosfiend the best place to look for jobs is here https://github.com/Expensify/App/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22
it's all jobs with the Help Wanted
label, the one's we're hiring for
Paid @parasharrajat
If you havenโt already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
User should be prioritized over group chats or rooms. The prioritization should be:
Ann
)Ann, Joe
orAnn's Room
)Actual Result:
Room is being prioritized over the user
Workaround:
No need.
Platform:
Where is this issue occurring?
Version Number: 1.1.15-1
Reproducible in staging?: Yes Reproducible in production?: Yes
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
Issue reported by: @mountiny Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1637012485218100
View all open jobs on GitHub