Open lanitochka17 opened 2 weeks ago
Triggered auto assignment to @joekaufmanexpensify (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.
Edited by proposal-police: This proposal was edited at 2024-11-12 14:23:20 UTC.
The expense preview shows "x paid amount" when expense payment is cancelled offline
iouSettled
condition is true if isSettled
function returns true or action.childStatusNum
is CONST.REPORT.STATUS_NUM.REIMBURSED
After paying the expense, action.childStatusNum
is updated correctly. But when we cancel the payment and unapproved the report, this status isn't updated (only the statusNum
of the expense report is updated).
It leads iouSettled
is still true
because this condition action?.childStatusNum === CONST.REPORT.STATUS_NUM.REIMBURSED
is still true
And the preview is displayed x paid amount
We should only check action?.childStatusNum
when the iou report data isn't available
const iouSettled = iouReport ? ReportUtils.isSettled(iouReportID) : action?.childStatusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
When we cancel the payment and unapproved the report we should update childStateNum
and childStatusNum
of the parent report action in optimistic data and reset it in failure data with the value like here and here
The value of childStateNum
and childStatusNum
will be the same as stateNum
and statusNum
values that we updated for the expense report. Here is an example
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${expenseReport.parentReportID}`,
value: {
[expenseReport.parentReportActionID]: {
childStateNum: stateNum,
childStatusNum: statusNum,
},
},
},
Reproduced. Yeah, if we're showing Approve
again on the report preview if you unapproved while offline, it seems odd that we are showing the report as paid when it was also canceled offline.
Seems like this is a pattern B situation based on the unapproved and payment cancel comments having .5 opacity. Not sure if we need to do something to signal on the report preview to signal pattern B too though.
https://github.com/user-attachments/assets/98b37b88-ea48-469a-ac1d-91b57398449e
Job added to Upwork: https://www.upwork.com/jobs/~021854562907265274025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External
)
@sobitneupane, @joekaufmanexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Pending @sobitneupane review of proposals
Thanks for the proposal @mkzie2
I prefer the alternative proposal as it directly addresses the root cause of the issue.
When we cancel the payment and unapproved the report we should update childStateNum and childStatusNum of the parent report action in optimistic data and reset it in failure data with the value like here and here
Could you clarify what values we should update childStateNum and childStatusNum to? It would be helpful if you could provide additional details for this alternative solution.
@sobitneupane In two places, we will update childStateNum
, childStatusNum
with the same stateNum
and statusNum
value that we updated for the expense report
@mkzie2 Could you please update the proposal with all the details.
Thanks for the update @mkzie2
Alternative proposal from @mkzie2 looks good to me.
π π π C+ reviewed
Triggered auto assignment to @marcaaron, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
π£ @mkzie2 π 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 π
PR in review
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.58-1 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers): applausetester+kh2610010@applause.expensifail.com Issue reported by: Applause - Internal Team
Action Performed:
Precondition:
Expected Result:
The expense preview will show "x owes amount" without checkmark because the expense payment is cancelled offline
Actual Result:
The expense preview shows "x paid amount" when expense payment is cancelled offline
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/user-attachments/assets/5e219d01-3bef-411c-8271-a6869e272d11
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @sobitneupane