Open IuliiaHerets opened 1 week ago
Triggered auto assignment to @abekkala (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.
Triggered auto assignment to @Julesssss (DeployBlockerCash
), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
💬 A slack conversation has been started in #expensify-open-source
:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Reproducible in production?: N/A - new feature, doesn't exist in prod
Demoting
Job added to Upwork: https://www.upwork.com/jobs/~021856301612409763010
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (External
)
Hi @IuliiaHerets, the reproduction steps aren't added yet. Could you please tag me when they are listed, thanks.
The status of the transaction does not show as paid when the transaction is part of a thread with multiple transaction and all transactions are paid.
To build the rows of the search results we call SearchUIUtils.getSections
in this line https://github.com/klajdipaja/Expensify-App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/components/Search/index.tsx#L209.
When the search is for all expenses it then calls: https://github.com/klajdipaja/Expensify-App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/libs/SearchUIUtils.ts#L212C10-L212C33.
In this function we try to resolve the action of the transaction in this line:
https://github.com/klajdipaja/Expensify-App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/libs/SearchUIUtils.ts#L227
The root cause is then hidden on this block:
https://github.com/klajdipaja/Expensify-App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/libs/SearchUIUtils.ts#L253-L256
because of this part of the conditon which is true: (isTransaction && !data[key].isFromOneTransactionReport)
To sum it up, it seems like it has been the intended behaviour that when the transaction is part of multiple transaction report it will show the View
action.
We should remove that part of the condition that checks for single transaction and make the conditon into this:
if (!isTransaction && !isReportEntry(key)) {
return CONST.SEARCH.ACTION_TYPES.VIEW;
}
And rely on the action returned by the backend for this transaction instead of using the isSettled method which relies on the report that the transaction belongs to because the report does not have the right data to understand individual transaction status.
To do that we can at this line after when we resolved the transaction: https://github.com/klajdipaja/Expensify-App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/libs/SearchUIUtils.ts#L257. this block:
if (transaction?.action === CONST.SEARCH.ACTION_TYPES.PAID) {
return CONST.SEARCH.ACTION_TYPES.PAID;
}
Edited by proposal-police: This proposal was edited at 2024-11-12 14:35:16 UTC.
Paid expenses do not have "Paid" label when the expenses are grouped expenses
When we get the actions, we check if the transaction is From One Transaction Report, for the bug description, it is false so we return the action to be CONST.SEARCH.ACTION_TYPES.VIEW
:
Here, to fix this, we should also check whether the report is a isMoneyRequestReport
and then only return the type as view, we do that but we do it below, after the above check:
https://github.com/Expensify/App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/libs/SearchUIUtils.ts#L260-L263 So we should update the code as such:
function getAction(data: OnyxTypes.SearchResults['data'], key: string): SearchTransactionAction {
const isTransaction = isTransactionEntry(key);
const transaction = isTransaction ? data[key] : undefined;
const report = isTransaction ? data[`${ONYXKEYS.COLLECTION.REPORT}${transaction?.reportID}`] : data[key];
if ((!isTransaction && !isReportEntry(key)) || (isTransaction && !data[key].isFromOneTransactionReport && !ReportUtils.isMoneyRequestReport(report))) {
return CONST.SEARCH.ACTION_TYPES.VIEW;
}
This will make sure that we only return the type as view if the report is a money request report.
In the Paid
section we also have the View
button displaying for transactions that are part of the group.
I don't think that's what the reported issue is about by looking at the recording but if that is also part of the issue, here is what we would need to do to fix that:
We have a forced View
mode in ActionCell.tsx
when the parent and current transaction are both PAID
.
If we want to show the Paid
checkmark we need to remove the shouldUseViewAction
boolean.
And also modify the condition here:
https://github.com/Expensify/App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/components/SelectionList/Search/ActionCell.tsx#L53
to remove the part that checks for the parent action:
if (action === CONST.SEARCH.ACTION_TYPES.PAID || action === CONST.SEARCH.ACTION_TYPES.DONE) {
Edited by proposal-police: This proposal was edited at 2024-11-12 14:54:39 UTC.
Paid expenses do not have "Paid" label when the expenses are grouped expenses
For combined transactions, isFromOneTransactionReport
will be false, which triggers the conditions below and causes View to be shown instead of Paid.
https://github.com/Expensify/App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/libs/SearchUIUtils.ts#L253-L255
but isFromOneTransactionReport
was added for the below case where we don't want to show pay
for individual transactions
Remove (isTransaction && !data[key].isFromOneTransactionReport)
https://github.com/Expensify/App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/libs/SearchUIUtils.ts#L253
Move this code block above this line https://github.com/Expensify/App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/libs/SearchUIUtils.ts#L291-L297
and at last change this line https://github.com/Expensify/App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/libs/SearchUIUtils.ts#L261
if (!ReportUtils.isMoneyRequestReport(report) || (isTransaction && !data[key].isFromOneTransactionReport)) {
return CONST.SEARCH.ACTION_TYPES.VIEW;
}
This solution will not break anything
https://github.com/user-attachments/assets/1558558d-9787-4377-9d51-cc982ca8fc0f
Alternatively, we can remove this (isTransaction && !data[key].isFromOneTransactionReport)
https://github.com/Expensify/App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/libs/SearchUIUtils.ts#L253
and after this line we can add
if(isTransaction && !data[key].isFromOneTransactionReport){
return CONST.SEARCH.ACTION_TYPES.VIEW;
}
Solution 3 We can also change this https://github.com/Expensify/App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/libs/SearchUIUtils.ts#L252-L255
if ((!isTransaction && !isReportEntry(key)) || (isTransaction && !data[key].isFromOneTransactionReport && !ReportUtils.isSettled(report) && !ReportUtils.isClosedReport(report))) {
return CONST.SEARCH.ACTION_TYPES.VIEW;
}
Search - Paid expenses do not have "Paid" label when the expenses are grouped expenses
Whenever we pay several transactions once, isFromOneTransactionReport
of transaction
is always false
.
Btw, in this below code, if isFromOneTransactionReport
is false, getAction return 'view'
.
https://github.com/klajdipaja/Expensify-App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/libs/SearchUIUtils.ts#L253-L255
So we are watching the 'view'
label in expenses search list.
If we want to see 'paid' at the moment, we should remove this below condition. https://github.com/klajdipaja/Expensify-App/blob/cd3f30f73a18c29532d6886b4bb3744fd700ab9d/src/libs/SearchUIUtils.ts#L253-L255 Here is the changed code.
if (!isTransaction && !isReportEntry(key)) {
return CONST.SEARCH.ACTION_TYPES.VIEW;
}
N/A
Your Expensify account email: anasup1995@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~01aff093c9a804b145
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@Julesssss Added steps, sorry of this
⚠️ Looks like this issue was linked to a Deploy Blocker here
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
I'll be handling this since I'm the author of the PR that caused the regression.
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.60-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 2024-11-20. :confetti_ball:
@Julesssss / @luacmartins @abekkala @Julesssss / @luacmartins The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Thanks @luacmartins, usubscribing
Not ready to be paid, we just reverted the PR and I'll be working on a fix for this.
@abekkala I'll unassign you since we reverted the PR and fixed this issue. I'm keeping it open to make sure I address the issue in the v2 of my PR.
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.61-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 2024-11-21. :confetti_ball:
@luacmartins @luacmartins The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
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.60-0 Reproducible in staging?: Y Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Slack conversation (hyperlinked to channel name):
Action Performed:
Expected Result:
Describe what you think should've happened
Actual Result:
Describe what actually happened
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
https://github.com/user-attachments/assets/2b6c006b-a2dd-449e-b60a-0986cd7bcb88
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @luacmartins