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-08-29] [$250] Dupe detect-Removing receipt on confirmation page also removes receipt from the actual expense #46373
Version Number: 9.0.13-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:
Go to staging.new.expensify.com
Go to workspace chat
Submit two expenses with same amount and merchant, but one with receipt and one without receipt
Click on the transaction thread of the expense with receipt
Click Review duplicates
Click Keep this one on the expense with receipt
Proceed to confirmation page
Click on the receipt on the confirmation page
Remove the receipt
Expected Result:
Since user is removing the receipt from the confirmation page, the receipt on the actual expense will not be removed, as the changes have not been "confirmed" yet
Actual Result:
When user removes the receipt from the confirmation page, the receipt on the actual expense is also removed, even when the Confirm button is not clicked
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
@anmurali 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
Please re-state the problem that we are trying to solve in this issue.
When user removes the receipt from the confirmation page, the receipt on the actual expense is also removed, even when the Confirm button is not clicked
What is the root cause of that problem?
We should not allow edit/delete the receipt when in duplicate confirmation page, just like other fields are not editable.
What changes do you think we should make in order to solve the problem?
To do that, we need to implement a mechanism to pass readonly from MoneyRequestView to TransactionReceipt page. Since they are not within a component tree, we can leverage the route params.
Introduce a new prop readonly to ReportActionItemImage and pass it from MoneyRequestViewhere
Introduce a new param readonly to TransactionReceipt screen here and its route here
When we navigate to TransactionReceipt screen from ReportActionItemImagehere, remember to pass readonly to getRoute
In TransactionReceipt, retrieve the readonly param from route and append to the canEditReceipt condition here to canEditReceipt={canEditReceipt && !readonly}
Edited by proposal-police: This proposal was edited at 2023-10-10T12:34:56Z.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Dupe detect-Removing receipt on confirmation page also removes receipt from the actual expense
What is the root cause of that problem?
On dupe confirmation page we disable all the field except receipt ReportActionItemImage. We should not allow user to open receipt on confirmation page, this is also the behaviour on submit request confirmation page.
What changes do you think we should make in order to solve the problem?
We already have enablePreviewModal prop in ReportActionItemImage.tsx which will prevent the app to open modal when enablePreviewModal is false because it renders only ReceiptImage without PressableWithoutFocus.
What alternative solutions did you explore? (Optional)
We can introduce a new prop interactive in ReportActionItemImage and pass it to PressableWithoutFocus interactive prop. The default value will be true
From MoneyRequestView we can pass !readonly to interactive prop of ReportActionItemImage.
Result
receipt_image_interactive_dupe_detection.mp4
Alternative
We can check the last route and if it is SCREENS.TRANSACTION_DUPLICATE.REVIEW, we will set the canEditReceipt to false. Similar approach is used here to do tasks according to the previous route. I still prefer the main solution since all other fields are also disabled and receipt should also behave the same way.
constisLastRouteDuplicateReview=(navigationRef.getRootState()?.routes?.at(-2)?.params?.params?.screen??'')===SCREENS.TRANSACTION_DUPLICATE.REVIEW;constcanEditReceipt=ReportUtils.canEditFieldOfMoneyRequest(parentReportAction,CONST.EDIT_REQUEST_FIELD.RECEIPT)&&!isLastRouteDuplicateReview;// If we want to hide the three dot icon, we can modify `allowDownload` prop.allowDownload={!isEReceipt&&!isLastRouteDuplicateReview}
changed the title [-]Dupe detect-Removing receipt on confirmation page also removes receipt from the actual expense[/-][+][$250] Dupe detect-Removing receipt on confirmation page also removes receipt from the actual expense[/+]on Jul 30, 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:
[@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:
[@sobitneupane] 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:
I don't think we can blame the PR for creating this issue as it is more of a feature-request than a bug.
[@sobitneupane] Determine if we should create a regression test for this bug.
Yes.
[@sobitneupane] 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.
Activity
melvin-bot commentedon Jul 27, 2024
Triggered auto assignment to @anmurali (
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.lanitochka17 commentedon Jul 27, 2024
@anmurali 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
lanitochka17 commentedon Jul 27, 2024
We think that this bug might be related to #wave-collect - Release 2
gijoe0295 commentedon Jul 28, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
When user removes the receipt from the confirmation page, the receipt on the actual expense is also removed, even when the Confirm button is not clicked
What is the root cause of that problem?
We should not allow edit/delete the receipt when in duplicate confirmation page, just like other fields are not editable.
App/src/pages/TransactionDuplicate/Confirmation.tsx
Lines 79 to 82 in 86b923d
App/src/components/ReportActionItem/MoneyRequestView.tsx
Line 499 in 9f650ba
What changes do you think we should make in order to solve the problem?
To do that, we need to implement a mechanism to pass
readonlyfromMoneyRequestViewtoTransactionReceiptpage. Since they are not within a component tree, we can leverage therouteparams.readonlytoReportActionItemImageand pass it fromMoneyRequestViewherereadonlytoTransactionReceiptscreen here and its route hereTransactionReceiptscreen fromReportActionItemImagehere, remember to passreadonlytogetRouteTransactionReceipt, retrieve thereadonlyparam fromrouteand append to thecanEditReceiptcondition here tocanEditReceipt={canEditReceipt && !readonly}gijoe0295 commentedon Jul 28, 2024
Proposal Update
Krishna2323 commentedon Jul 28, 2024
Edited by proposal-police: This proposal was edited at 2023-10-10T12:34:56Z.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Dupe detect-Removing receipt on confirmation page also removes receipt from the actual expense
What is the root cause of that problem?
ReportActionItemImage. We should not allow user to open receipt on confirmation page, this is also the behaviour on submit request confirmation page.App/src/components/ReportActionItem/MoneyRequestView.tsx
Lines 459 to 468 in 08bb00b
money_request_confrimation.mp4
What changes do you think we should make in order to solve the problem?
enablePreviewModalprop inReportActionItemImage.tsxwhich will prevent the app to open modal whenenablePreviewModalis false because it renders onlyReceiptImagewithoutPressableWithoutFocus.App/src/components/ReportActionItem/ReportActionItemImage.tsx
Lines 124 to 143 in 08bb00b
enablePreviewModalprop toenablePreviewModal={!readonly}.App/src/components/ReportActionItem/MoneyRequestView.tsx
Line 467 in 08bb00b
What alternative solutions did you explore? (Optional)
interactiveinReportActionItemImageand pass it toPressableWithoutFocusinteractive prop. The default value will be trueMoneyRequestViewwe can pass!readonlytointeractiveprop ofReportActionItemImage.Result
receipt_image_interactive_dupe_detection.mp4
Alternative
We can check the last route and if it is
SCREENS.TRANSACTION_DUPLICATE.REVIEW, we will set thecanEditReceiptto false. Similar approach is used here to do tasks according to the previous route. I still prefer the main solution since all other fields are also disabled and receipt should also behave the same way.App/src/pages/TransactionReceiptPage.tsx
Line 36 in f7e265a
App/src/pages/TransactionReceiptPage.tsx
Line 62 in f7e265a
Result Alternative
Monosnap.screencast.2024-07-31.18-11-07.mp4
[-]Dupe detect-Removing receipt on confirmation page also removes receipt from the actual expense[/-][+][$250] Dupe detect-Removing receipt on confirmation page also removes receipt from the actual expense[/+]melvin-bot commentedon Jul 30, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01e50d0c63fac1b4f3
46 remaining items
gijoe0295 commentedon Aug 29, 2024
@anmurali This is ready for payment.
sobitneupane commentedon Sep 2, 2024
Regression Test Proposal:
Do we agree 👍 or 👎
sobitneupane commentedon Sep 2, 2024
#40153
I don't think we can blame the PR for creating this issue as it is more of a feature-request than a bug.
Yes.
#46373 (comment)
melvin-bot commentedon Sep 2, 2024
@anmurali, @sobitneupane, @stitesExpensify, @gijoe0295 Huh... This is 4 days overdue. Who can take care of this?
stitesExpensify commentedon Sep 3, 2024
@anmurali all you on this one!
melvin-bot commentedon Sep 4, 2024
@anmurali, @sobitneupane, @stitesExpensify, @gijoe0295 Still overdue 6 days?! Let's take care of this!
melvin-bot commentedon Sep 6, 2024
@anmurali, @sobitneupane, @stitesExpensify, @gijoe0295 Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
anmurali commentedon Sep 9, 2024
Payment Summary
garrettmknight commentedon Oct 23, 2024
$250 approved for @sobitneupane