Closed lanitochka17 closed 4 months ago
Triggered auto assignment to @johncschuster (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.
We think that this bug might be related to #vip-vsp
@johncschuster 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
System message (like changing of merchant) appears as subtitle of self DM in LHN. It should only appear as last message in the transaction thread and not in the selfDM in LHN.
This bug happens only when there is only one transaction in the self DM report.
Here in OptionsListUtils
https://github.com/Expensify/App/blob/0cb2dc052f01b6a024ac872ad8bf628159fe7873/src/libs/OptionsListUtils.ts#L291-L299
we merge the transaction thread report actions into IOU report actions if it is oneTransactionThreadReport so the last transaction of modified merchant is added into the report actions and set as the lastReportAction. In the present case of self DM, the lastMessage of modifying merchant appears on the LHN.
But this merging of transaction thread report actions for single transaction reports is not applicable for self DM because unlike other reports the tracked expenses are shown as separate report actions here instead of a single report preview merging all IOUs as shown in other reports.
Additionally, we don't see this report action of modifying merchant in the self DM report screen though the transaction report actions are added here as well
https://github.com/Expensify/App/blob/0cb2dc052f01b6a024ac872ad8bf628159fe7873/src/pages/home/report/ReportActionsView.tsx#L160
with transactionThreadReportActions
obtained from onyx with the transactionThreadReportID
passed from ReportScreen
https://github.com/Expensify/App/blob/0cb2dc052f01b6a024ac872ad8bf628159fe7873/src/pages/home/ReportScreen.tsx#L331-L334
This is because there is a check here when getting the getOneTransactionThreadReportID
https://github.com/Expensify/App/blob/0cb2dc052f01b6a024ac872ad8bf628159fe7873/src/libs/ReportActionsUtils.ts#L878-L887
and it returns null
when the skipReportTypeCheck
is passed as false
as seen here for track expenses because it is not one of the actions being checked there
https://github.com/Expensify/App/blob/0cb2dc052f01b6a024ac872ad8bf628159fe7873/src/pages/home/ReportScreen.tsx#L332
whereas it is passed as true
here
https://github.com/Expensify/App/blob/0cb2dc052f01b6a024ac872ad8bf628159fe7873/src/libs/OptionsListUtils.ts#L293
which skips the check. If the check is not skipped it returns null
and LHN shows correct message.
We can check if the report is self DM and pass the boolean here https://github.com/Expensify/App/blob/0cb2dc052f01b6a024ac872ad8bf628159fe7873/src/libs/OptionsListUtils.ts#L293 like
const isSelfDM = ReportUtils.isSelfDM(ReportUtils.getReport(reportID));
// If the report is a one-transaction report and has , we need to return the combined reportActions so that the LHN can display modifications
// to the transaction thread or the report itself
const transactionThreadReportID = ReportActionUtils.getOneTransactionThreadReportID(reportID, actions[reportActions[0]], !isSelfDM);
I see this skip of check added here in #39472 for showing correct messages in LHN for edge cases. I changed the skipcheck to false
in OptionsListUtils
directly (irrespective of whether it is a self DM or not) and the tests succeeded fine. So, we might consider changing this
https://github.com/Expensify/App/blob/0cb2dc052f01b6a024ac872ad8bf628159fe7873/src/libs/OptionsListUtils.ts#L293
simply to
const transactionThreadReportID = ReportActionUtils.getOneTransactionThreadReportID(reportID, actions[reportActions[0]], false);
Job added to Upwork: https://www.upwork.com/jobs/~01e89fac46add8bf9d
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts (External
)
Reviewing today.
@c3024's proposal looks good to me. I would suggest to go with the main proposal since its less likely to cause a regression.
π π π C+ reviewed
Triggered auto assignment to @NikkiWines, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
I see this skip of check added here in https://github.com/Expensify/App/pull/39472 for showing correct messages in LHN for edge cases. I changed the skipcheck to false in OptionsListUtils directly (irrespective of whether it is a self DM or not) and the tests succeeded fine. So, we might consider changing this
I just double-checked this, and the behavior without the skipReportType
check is fine for me as well. Even though I agree with @allroundexperts that it's more likely to cause regressions, I think we should use the alternative proposal, but go one step further and remove the skipReportTypeCheck
altogether since it's apparently unnecessary now.
@allroundexperts @c3024 how does that sound to you?
Yes, let's remove it. I don't think anything will be broken.
π£ @c3024 π An offer has been automatically sent to your Upwork account for the Contributor role π Thanks for contributing to the Expensify app!
Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review π§βπ» Keep in mind: Code of Conduct | Contributing π
@allroundexperts PR ready for review!
@johncschuster This was deployed to production 4 days ago but automation failed here.
@johncschuster Can you please complete the payment here? This was deployed to production 10 days ago. Thanks!
Contributor: @c3024 paid $250 via Upwork Contributor+: @allroundexperts due $250 via NewDot
@allroundexperts can you fill out the BZ checklist plzzzz
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:
@johncschuster @NikkiWines @allroundexperts @c3024 this issue is now 4 weeks old, please consider:
Thanks!
On to the checklist today.
Verify that the system message indicating merchant or description being updated gets displayed on LHN for the combined report of the tracked expense only.
Do we π or π ?
Thanks @allroundexperts
$250 approved for @allroundexperts
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: 1.4.77-3 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:
System message indicating merchant or description being updated gets displayed on LHN for the combined report of the tracked expense only
Actual Result:
System message indicating merchant or description being updated is shown on the LHN of the personal space report
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/b4b095fa-7c13-433e-b93e-d4955399a2e4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @allroundexperts