Repository navigation
[HOLD for payment 2024-07-24] [$250] [Search v1] Search shows User A submits to User B when User B submits to User A in the same report #44093
Description
Activity
- addedDailyKSv2KSv2BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on Jun 20, 2024 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.@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
Proposal
Please re-state the problem that we are trying to solve in this issue.
Search shows incorrect same
fromandtofor all expenses between a set of users though some of the expenses havefromand to the other way.What is the root cause of that problem?
The following portion till "Outdated ends" is no more applicable because it was fixed with a backend change as mentioned here.
Outdated
_If the sum of all the IOUs between two users A and B comes to be "User A owes X", all the transactions have same
from'B' andto'A' for all transactions passed here
{reportItem.transactions.map((transaction) => (
sofrom'B' andto'A' is same for all transactions.What changes do you think we should make in order to solve the problem?
We should swap the
fromandtobased on theamountin thetransaction.


something like thisconst participantFrom = item.amount > 0 ? item.from : item.to; const participantTo = item.amount > 0 ? item.to : item.from; const participantFromDisplayName = item.amount > 0 ? item.formattedFrom : item.formattedTo; const participantToDisplayName = item.amount > 0 ? item.formattedTo : item.formattedFrom;
in
TransactionListItemRowand pass these here
App/src/components/SelectionList/Search/TransactionListItemRow.tsx
Lines 313 to 321 in b021195
<UserInfoCell participant={item.from} displayName={item.formattedFrom} /> </View> <View style={[StyleUtils.getSearchTableColumnStyles(CONST.SEARCH_TABLE_COLUMNS.FROM)]}> <UserInfoCell participant={item.to} displayName={item.formattedTo}
and hereOutdated ends
Now there is a little frontend change necessary because for the narrower screen we show this
App/src/components/SelectionList/Search/TransactionListItemRow.tsx
Lines 228 to 232 in b021195
<ExpenseItemHeaderNarrow participantFrom={item.from} participantFromDisplayName={item.formattedFrom} participantTo={item.to} participantToDisplayName={item.formattedTo}
and thefromandtovalues for the whole report is taken as thefromandtoof the first transaction.
App/src/components/SelectionList/Search/ReportListItem.tsx
Lines 89 to 95 in 9d88c63
const participantFrom = reportItem.transactions[0].from; const participantTo = reportItem.transactions[0].to; // These values should come as part of the item via SearchUtils.getSections() but ReportListItem is not yet 100% handled // This will be simplified in future once sorting of ReportListItem is done const participantFromDisplayName = participantFrom?.name ?? participantFrom?.displayName ?? participantFrom?.login ?? ''; const participantToDisplayName = participantTo?.name ?? participantTo?.displayName ?? participantTo?.login ?? '';
This need not always betruebecause the first transactionaccountIDandmanagerIDneed not be the same as theaccountIDandmanagerIDfor the whole report.
Now that the report sent from backend hasmanagerIDandaccountIDs we can get theparticipantFromvalue from thefromortoof the first transaction by comparing theaccountIDof thereportwithmanagerIDoraccountIDof thetransaction. We can getparticipantTosimilarly.What alternative solutions did you explore? (Optional)
- addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on Jun 24, 2024 - changed the title
[-]Search- Search shows User A submits to User B when User B submits to User A in the same report[/-][+][$250] Search- Search shows User A submits to User B when User B submits to User A in the same report[/+]on Jun 24, 2024 Job added to Upwork: https://www.upwork.com/jobs/~01bc65eaf7cfc97061
- addedHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributors
on Jun 24, 2024 Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (
External)53 remaining items
- changed the title
[-][HOLD for payment 2024-07-17] [$250] [Search v1] Search shows User A submits to User B when User B submits to User A in the same report[/-][+][HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] [Search v1] Search shows User A submits to User B when User B submits to User A in the same report[/+]on Jul 15, 2024 The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.6-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-07-22. 🎊
For reference, here are some details about the assignees on this issue:
- @brunovjk requires payment automatic offer (Reviewer)
- @c3024 requires payment automatic offer (Contributor)
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:
- [@brunovjk / @c3024] The PR that introduced the bug has been identified. Link to the PR:
- [@brunovjk / @c3024] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
- [@brunovjk / @c3024] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
- [@brunovjk / @c3024] Determine if we should create a regression test for this bug.
- [@brunovjk / @c3024] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
- [@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Reacted by Bruno RochaAwesome. Thanks for clarifying, @luacmartins! I'll be standing by for payment 👍
Reacted by Carlos MartinsLooks like the linked PR just hit prod. Payment should be issued on July 24 assuming no regressions.
Reacted by Bruno Rocha- changed the title
[-][HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] [Search v1] Search shows User A submits to User B when User B submits to User A in the same report[/-][+][HOLD for payment 2024-07-24] [$250] [Search v1] Search shows User A submits to User B when User B submits to User A in the same report[/+]on Jul 17, 2024 No regressions so far. We're still on track to pay this out on the 24th 👍
Reacted by Bruno Rocha- [@brunovjk] The PR that introduced the bug has been identified. Link to the PR: N/A
- [@brunovjk] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: N/A
- [@brunovjk] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
- [@brunovjk] Determine if we should create a regression test for this bug. Yes
- [@brunovjk] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
Regression Test Proposal
- Launch New Expensify app.
- Create a new workspace.
- [User A] Submit an expense for amount 'X' (e.g., 10 units) to [User B].
- [User B] Submit an expense for amount 'Y' (e.g., 20 units) to [User A].
- [User A] Submit an expense to the workspace.
- Go to Search > Shared.
- Verify that:
- The From and To fields are correctly displayed for each expense (e.g., User B in From field and User A in To field for the expense from User B).
- The total amount accurately reflects the sum of both user expenses with correct indications.
- The workspace expense is grouped correctly and shows that it was submitted to the workspace.
Do we agree 👍 or 👎
Reacted by John SchusterPayment has been issued! Thanks for your contributions!
Reacted by Bruno Rocha- moved this from Polish to Done in [#whatsnext] #wave-collect
on Jul 24, 2024
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
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.86-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: https://expensify.testrail.io/index.php?/tests/view/4647855
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
From and To field for the expense submitted by User B will show User B in From field and User A in To field
Actual Result:
From and To field for the expense submitted by User B will show User A in From field and User B in To field, when it is submitted from User B and User A
The Total field also does not make sense either. The amount sent by User A should be indicated by a negative or better indication so that the total amount correctly reflects the sum of both expenses
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6519453_1718891782532.bandicam_2024-06-20_21-49-16-902.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @johncschuster