You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-11-01] Invoices - Receipt appears on invoice confirmation page if receipt is added from track expense #50303
Version Number: 9.0.45-2 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers):applausetester+pso@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Go to staging.new.expensify.com
Go to FAB > Send invoices.
Enter amount and select a receiver.
Note that there is no receipt option on the confirmation page.
Click back button.
Click Just track it (don’t submit it).
Add a receipt from the 3-dot menu.
Click back button.
Select a receiver.
Expected Result:
Receipt will not appear on the invoice confirmation page because invoice does not support receipt (evident from Step 4).
Actual Result:
Receipt appears on invoice confirmation page if receipt is added from track expense first.
@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
What changes do you think we should make in order to solve the problem?
You can see that if we add categories during the invoice flow and then go back to start the track expense flow, the categories will still be present in the transaction object. However, we don’t see the categories on the screen because we hide them using this check.
Alternative 2
Or we can use setMoneyRequestReceipt to clear the receipt details from transaction object. We can do something like in IOURequestStepConfirmation.tsx
Please re-state the problem that we are trying to solve in this issue.
Receipt appears on invoice confirmation page if receipt is added from track expense
What is the root cause of that problem?
In this case, we have two separate flows: "Send Invoice" and "Track Expense." However, both flows save their data in the same place, "transactionsDraft_1." This results in the receipt from the "Track Expense" flow also being added to the "Send Invoice" flow
A similar issue occurs with the category field, which only exists in the "Send Invoice" flow. If a value is added to category and then "Track Expense" is executed, the category field still appears in the payload of the "Track Expense" API
What changes do you think we should make in order to solve the problem?
"transactionsDraft_1" can be used to share common information like description, amount, and merchant,... as these exist in both flows. However, if we continue saving receipt information and the category field in "transactionsDraft_1" as we do now, we will need to make some adjustments:
For the "Track Expense" flow: We need to hide the category field on the confirmation page and remove it from the API payload.
For the "Send Invoice" flow: We need to hide the receipt information on the confirmation page and remove it from the API payload.
What alternative solutions did you explore? (Optional)
We can save the "Track Expense" information to a new ONYX state (transactionDraft_sideFlow), keeping the data for both flows completely separate. However, the downside of this approach is that any shared information between the two flows will not be available in both.
I think we want to put this one in #f1 as it's a bug from there. @grgia, who's working on this with you? I don't think we should show the "just track it" option in the Send invoice flow. CC: @anmurali
changed the title [-]Invoices - Receipt appears on invoice confirmation page if receipt is added from track expense[/-][+][HOLD for payment 2024-11-01] Invoices - Receipt appears on invoice confirmation page if receipt is added from track expense[/+]on Oct 25, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.53-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve 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:
[@grgia] The PR that introduced the bug has been identified. Link to the PR:
[@grgia] 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:
[@grgia] 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:
[@fabioh8010] Determine if we should create a regression test for this bug.
[@fabioh8010] 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.
[@trjExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Activity
melvin-bot commentedon Oct 6, 2024
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.IuliiaHerets commentedon Oct 6, 2024
We think that this bug might be related to #vip-bills
IuliiaHerets commentedon Oct 6, 2024
@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
Nodebrute commentedon Oct 6, 2024
Edited by proposal-police: This proposal was edited at 2024-10-06 17:29:32 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Receipt appears on invoice confirmation page if receipt is added from track expense
What is the root cause of that problem?
When we add the receipt it gets added to this transaction and then we move back to send invoice we can see the receipt.
App/src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Line 624 in 99f280b
What changes do you think we should make in order to solve the problem?
You can see that if we add categories during the invoice flow and then go back to start the track expense flow, the categories will still be present in the transaction object. However, we don’t see the categories on the screen because we hide them using this check.
App/src/components/MoneyRequestConfirmationList.tsx
Line 261 in 99f280b
The same we can do with receipts. We can add another check here
!isTypeInvoiceApp/src/components/MoneyRequestConfirmationListFooter.tsx
Line 636 in 99f280b
What alternative solutions did you explore? (Optional)
We can pass the
shouldDisplayReceipt={iouType !== CONST.IOU.TYPE.INVOICE}App/src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Line 623 in 99f280b
and then we can use it here to hide the receipt
App/src/components/MoneyRequestConfirmationListFooter.tsx
Line 636 in 99f280b
Alternative 2
Or we can use
setMoneyRequestReceiptto clear the receipt details from transaction object. We can do something like inIOURequestStepConfirmation.tsxpseudo-code
Optional: We can also add
!isTypeInvoicecheck too to hide receipt.Optional 2: we can also use null instead of
''Nodebrute commentedon Oct 6, 2024
Proposal updated
Added alternative solution 2
cretadn22 commentedon Oct 7, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Receipt appears on invoice confirmation page if receipt is added from track expense
What is the root cause of that problem?
In this case, we have two separate flows: "Send Invoice" and "Track Expense." However, both flows save their data in the same place, "transactionsDraft_1." This results in the receipt from the "Track Expense" flow also being added to the "Send Invoice" flow
A similar issue occurs with the category field, which only exists in the "Send Invoice" flow. If a value is added to category and then "Track Expense" is executed, the category field still appears in the payload of the "Track Expense" API
What changes do you think we should make in order to solve the problem?
"transactionsDraft_1" can be used to share common information like description, amount, and merchant,... as these exist in both flows. However, if we continue saving receipt information and the category field in "transactionsDraft_1" as we do now, we will need to make some adjustments:
What alternative solutions did you explore? (Optional)
We can save the "Track Expense" information to a new ONYX state (transactionDraft_sideFlow), keeping the data for both flows completely separate. However, the downside of this approach is that any shared information between the two flows will not be available in both.
trjExpensify commentedon Oct 7, 2024
I think we want to put this one in #f1 as it's a bug from there. @grgia, who's working on this with you? I don't think we should show the "just track it" option in the
Send invoiceflow. CC: @anmuralitrjExpensify commentedon Oct 7, 2024
I'll hold off on
Help wantedfor now, as we might want to route this back to whoever is working on that project as a regression.trjExpensify commentedon Oct 10, 2024
Bumped in thread: https://expensify.slack.com/archives/C07HPDRELLD/p1728580440064929?thread_ts=1728363084.092579&cid=C07HPDRELLD
Doesn't look like @fabioh8010 has access to that channel though, so tagging you here!
13 remaining items
fabioh8010 commentedon Oct 18, 2024
PR was opened to review.
allgandalf commentedon Oct 18, 2024
I was assigned to the ^ PR, does that require C+ review ?
allgandalf commentedon Oct 21, 2024
bump on ^ @grgia
[-]Invoices - Receipt appears on invoice confirmation page if receipt is added from track expense[/-][+][HOLD for payment 2024-11-01] Invoices - Receipt appears on invoice confirmation page if receipt is added from track expense[/+]melvin-bot commentedon Oct 25, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Oct 25, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.53-1 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-11-01. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Oct 25, 2024
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: