Closed lanitochka17 closed 3 weeks ago
Triggered auto assignment to @trjExpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@trjExpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
An invoice thread opens when we select the user from new chat page.
When we select a user, it will try to find the user chat by participants using getChatByParticipants
.
https://github.com/Expensify/App/blob/a19ef9889c85991414943da1515abe811c05e31d/src/libs/ReportUtils.ts#L5561-L5584
The participants of the invoice report is the same as the DM participants, that is [currentUser, the other user]. Because they contains the same participant, getChatByParticipants
has a chance to wrongly returns the wrong report, that is the invoice report instead of the DM.
Skip invoice report/room when comparing the participant. https://github.com/Expensify/App/blob/a19ef9889c85991414943da1515abe811c05e31d/src/libs/ReportUtils.ts#L5567-L5577
|| isInvoiceReport(report) || isInvoiceRoom(report)
(and any other report type if needed)
I want to propose using !isOneOnOneChat
, but getChatByParticipants
is also being used to find group chat in split bill.
https://github.com/Expensify/App/blob/a19ef9889c85991414943da1515abe811c05e31d/src/libs/actions/IOU.ts#L3806-L3809
So, the solution is if we aren't searching for group, then we use !isOneOnOneChat(report)
condition.
|| (!shouldIncludeGroupChats && !isOneOnOneChat(report))
Then, we can remove the other checks (thread, group, task, etc.)
@cristipaval @davidcardoza for eyes on this.
Job added to Upwork: https://www.upwork.com/jobs/~0165c9231ff254ae89
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rayane-djouah (External
)
Invoice - Invoice thread opens when starting DM with the user after sending invoice to them
When we start DM with the user, we use getChatByParticipants
function to find the report of the DM chat. In this function, we will exclude some types of reports and then compare the participants. But we don't exclude the invoice report and this report has the same participant with the DM chat. So sometimes this function can return wrongly if we find the invoice report first.
To avoid this bug happening in the future, we can prioritize the one one chat and group chat. With this change, we can make sure that this function will always return the DM or group first if the participant is matched.
return lodashOrderBy(Object.values(reports ?? {}), (report) => {
if (isOneOnOneChat(report) || (isGroupChat(report) && shouldIncludeGroupChats)) {
return 0;
}
return 1;
}).find((report) => {
Reviewing proposals
@bernhardoj's proposal looks good to me.
:ribbon::eyes::ribbon: C+ reviewed
Triggered auto assignment to @cristipaval, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
๐ฃ @rayane-djouah ๐ An offer has been automatically sent to your Upwork account for the Reviewer role ๐ Thanks for contributing to the Expensify app!
PR is ready
cc: @rayane-djouah
Deployed to staging 4 hours ago.
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.11-5 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 2024-08-01. :confetti_ball:
For reference, here are some details about the assignees on this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
Checklist time!
Requested in ND
cc @trjExpensify
Determine if we should create a regression test for this bug. There's no need; we've already included automated tests.
Hm, I don't think we forgo manual regression testing of features in lieu of automated tests. @cristipaval @davidcardoza are manual regression tests being handed over and added centrally for this project?
Payment summary as follows:
^^ going to hold on the Upwork payment for C+ until we're aligned on this Q.
@trjExpensify - Below are the manual regression test steps if we decide to include them:
Regression Test Proposal
Send Invoice flow:
Submit expense flow:
Do we agree ๐ or ๐
Cool, thanks! Settled up. ๐
$250 approved for @bernhardoj
If you havenโt already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.6-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
DM with the user will open
Actual Result:
Invoice thread with the user opens
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/78819774/f0529ee6-dbab-4f63-9714-956f7a1f8240
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @trjExpensify