Skip to content

[HOLD for Payment 09-17][$250] Dupe detect - Incorrect receipt on confirmation page when expenses have different receipt #47774

Closed

Description

@IuliiaHerets

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: v9.0.23-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): applausetester+kh050806@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Submit two same expenses (same amount and merchant) but with different receipts.
  4. Go to transaction thread of the second expense.
  5. Click Review duplicates.
  6. Click Keep this one on the first expense.
  7. Proceed to confirmation page.

Expected Result:

The confirmation page will show the receipt of the first expense because the first expense is selected in Step 6.

Actual Result:

The confirmation page shows the receipt of the second expense when the first expense is selected in Step 6.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6577537_1724191242282.Red_dot_not_displayed.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01923b3933ce1dcc46
  • Upwork Job ID: 1828094692816105858
  • Last Price Increase: 2024-08-26
  • Automatic offers:
    • shubham1206agra | Reviewer | 103782432
    • nkdengineer | Contributor | 103782433
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 21, 2024
  2. melvin-bot commented on Aug 21, 2024

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (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.

  3. IuliiaHerets commented on Aug 21, 2024

    @IuliiaHerets
    Author

    We think that this bug might be related to #wave-collect - Release 2

  4. IuliiaHerets commented on Aug 21, 2024

    @IuliiaHerets
    Author

    @mallenexpensify 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

  5. Krishna2323 commented on Aug 21, 2024

    @Krishna2323
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-08-28 03:46:21 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Dupe detect - Incorrect receipt on confirmation page when expenses have different receipt

    What is the root cause of that problem?

    • We are using the transactionID from originalMessage?.IOUTransactionID which will be the first transaction in the report.
    • When we are on confirmation page of review duplicates we need to use the transactionID of the selected duplicate.

    const linkedTransactionID = useMemo(() => {
    const originalMessage = parentReportAction && ReportActionsUtils.isMoneyRequestAction(parentReportAction) ? ReportActionsUtils.getOriginalMessage(parentReportAction) : undefined;
    return originalMessage?.IOUTransactionID ?? '-1';
    }, [parentReportAction]);
    const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${linkedTransactionID}`);

    <MoneyRequestView
    report={report}
    shouldShowAnimatedBackground={false}
    readonly
    updatedTransaction={transaction as OnyxEntry<Transaction>}
    />

    What changes do you think we should make in order to solve the problem?

    • When we have the updatedTransaction, we should be using updatedTransaction.transactionID instead of linkedTransactionID.

    const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${linkedTransactionID}`);

    const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${updatedTransaction?.transactionID ? updatedTransaction.transactionID : linkedTransactionID}`);
    • Same can be done for transactionBackup but I guess it's not needed.

    Note: The reason we use conditions like updatedTransactionDescription ?? transactionDescription is that the updated details aren't included in the transaction. However, for other details like receipt, we can use the transaction object, and we can get the correct transaction using the solution mentioned above.

    title={updatedTransactionDescription ?? transactionDescription}

    What alternative solutions did you explore? (Optional)



    Result

    Monosnap.screencast.2024-08-21.14-41-04.mp4
  6. nkdengineer commented on Aug 21, 2024

    @nkdengineer
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    The confirmation page shows the receipt of the second expense when the first expense is selected in Step 6.

    What is the root cause of that problem?

    In this case, the linkedTransactionID is the transactionID of the second transaction because we're reviewing the duplicate in the transaction thread report of the second transaction.

    const linkedTransactionID = useMemo(() => {
    const originalMessage = parentReportAction && ReportActionsUtils.isMoneyRequestAction(parentReportAction) ? ReportActionsUtils.getOriginalMessage(parentReportAction) : undefined;
    return originalMessage?.IOUTransactionID ?? '-1';
    }, [parentReportAction]);

    Then we're getting the receipt URI from transaction data so the receipt of the second expense is displayed

    if (hasReceipt) {
    receiptURIs = ReceiptUtils.getThumbnailAndImageURIs(transaction);
    }
    const pendingAction = transaction?.pendingAction;
    const getPendingFieldAction = (fieldPath: TransactionPendingFieldsKey) => transaction?.pendingFields?.[fieldPath] ?? pendingAction;

    What changes do you think we should make in order to solve the problem?

    We should get the receipt URI data from updatedTransaction if it is not empty. Maybe we should update other places like here, here, here

    if (hasReceipt) {
        receiptURIs = ReceiptUtils.getThumbnailAndImageURIs(updatedTransaction ?? transaction);
    }
    

    if (hasReceipt) {
    receiptURIs = ReceiptUtils.getThumbnailAndImageURIs(transaction);
    }

    This solution is the same way as we do in other places like here

    title={updatedTransactionDescription ?? transactionDescription}

    What alternative solutions did you explore? (Optional)

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 26, 2024
  8. changed the title [-]Dupe detect - Incorrect receipt on confirmation page when expenses have different receipt[/-] [+][$250] Dupe detect - Incorrect receipt on confirmation page when expenses have different receipt[/+] on Aug 26, 2024
  9. melvin-bot commented on Aug 26, 2024

    @melvin-bot
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 26, 2024
  11. melvin-bot commented on Aug 26, 2024

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (External)

  12. 29 remaining items

  13. shubham1206agra commented on Sep 18, 2024

    @shubham1206agra
    Contributor

    @nkdengineer @shubham1206agra , can you confirm you two should be paid here? Once you do I'll take care of, ths

    @mallenexpensify Yes, we need to be paid here

  14. mallenexpensify commented on Sep 19, 2024

    @mallenexpensify
    Contributor

    Contributor: @nkdengineer paid $250 via Upwork
    Contributor+: @shubham1206agra paid $250 via Upwork.

    @shubham1206agra can you please accept the job and reply here once you have?
    https://www.upwork.com/jobs/~01923b3933ce1dcc46

  15. shubham1206agra commented on Sep 20, 2024

    @shubham1206agra
    Contributor

    @mallenexpensify I accepted the offer

  16. mallenexpensify commented on Sep 20, 2024

    @mallenexpensify
    Contributor

    @shubham1206agra paid, plz complete the BZ checklist.

    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:

    • [@] The PR that introduced the bug has been identified. Link to the PR:
    • [@] 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:
    • [@] 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:
    • [@] Determine if we should create a regression test for this bug.
    • [@] 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.
    • [@bz] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  17. shubham1206agra commented on Sep 21, 2024

    @shubham1206agra
    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:

  18. mallenexpensify commented on Sep 23, 2024

    @mallenexpensify
    Contributor

    @shubham1206agra do we want a regression test for this? If not, why not? Thx

  19. shubham1206agra commented on Sep 24, 2024

    @shubham1206agra
    Contributor

    @shubham1206agra do we want a regression test for this? If not, why not? Thx

    No since confirmation page test should cover this also.

  20. mallenexpensify commented on Sep 24, 2024

    @mallenexpensify
    Contributor

    Thanks @shubham1206agra , we should be all good here then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorNeeds ReproductionReproducible steps needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions