Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.56k stars 2.9k forks source link

[HOLD for payment 2024-10-29] [$250] Dupe detect - Tag name on the confirmation page follows custom tag name from other workspace #50662

Closed IuliiaHerets closed 2 weeks ago

IuliiaHerets commented 1 month ago

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

Action Performed:

Precondition:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat A.
  3. Submit an expense.
  4. Go to workspace chat B.
  5. Submit the same expense as Step 3.
  6. Submit another dupe expense on both workspaces (a different amount).
  7. Go back to workspace chat A and open the transaction thread from Step 3 (because Keep this one button won't appear in Step 9 if this is not opened first).
  8. Go to transaction thread of the expense from Step 5.
  9. Click Review duplicates.
  10. Click Keep this one on the second expense in the list (this expense is from Step 3).
  11. Proceed to confirmation page.

Expected Result:

The tag name on the confirmation page will show the custom tag name from workspace A, because the expense from workspace A is selected on review duplicates page (from Step 9).

Actual Result:

The tag name on the confirmation page shows the custom tag name from workspace B, when the expense from workspace A is selected.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/ca858588-cf72-414a-8b1b-f3ac4ad63786

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021845671687760709934
  • Upwork Job ID: 1845671687760709934
  • Last Price Increase: 2024-10-14
  • Automatic offers:
    • suneox | Reviewer | 104426916
    • truph01 | Contributor | 104426918
Issue OwnerCurrent Issue Owner: @Christinadobrzyn
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @Christinadobrzyn (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 commented 1 month ago

We think that this bug might be related to #wave-control

IuliiaHerets commented 1 month ago

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

truph01 commented 1 month ago

Edited by proposal-police: This proposal was edited at 2024-10-12 06:06:56 UTC.

Proposal

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

The tag name on the confirmation page shows the custom tag name from workspace B, when the expense from workspace A is selected.

What is the root cause of that problem?

https://github.com/Expensify/App/blob/e4969b22e7dbb1f6a200cc587ced4ab665415c0e/src/components/ReportActionItem/MoneyRequestView.tsx#L93

because policyID points to the policyID of the report that we are opening: https://github.com/Expensify/App/blob/e4969b22e7dbb1f6a200cc587ced4ab665415c0e/src/pages/TransactionDuplicate/Confirmation.tsx#L45 caused the bug that confirmation page shows the custom tag name from workspace B, when the expense from workspace A is selected.

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

    const targetPolicyID = updatedTransaction?.reportID ? ReportUtils.getReport(updatedTransaction?.reportID)?.policyID : policyID;
    const [policyTagList] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${targetPolicyID}`);

and apply it to other similar places.

What alternative solutions did you explore? (Optional)

Christinadobrzyn commented 1 month ago

Oh interesting - I can reproduce this, I think this can be external so let's start there.

melvin-bot[bot] commented 1 month ago

Job added to Upwork: https://www.upwork.com/jobs/~021845671687760709934

melvin-bot[bot] commented 1 month ago

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

suneox commented 1 month ago

The proposal from @truph01 LGTM. In this case, since we have an updatedTransaction so we should retrieve the target policy from the updatedTransaction

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed

melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @MariaHCD, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

MariaHCD commented 1 month ago

Sounds good to me πŸ‘πŸΌ

melvin-bot[bot] commented 1 month ago

πŸ“£ @suneox πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 1 month ago

πŸ“£ @truph01 πŸŽ‰ 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 πŸ“–

melvin-bot[bot] commented 4 weeks ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 4 weeks ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.51-4 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-10-29. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 4 weeks ago

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:

suneox commented 3 weeks ago

Checklist

Christinadobrzyn commented 3 weeks ago

Looks like payment is tomorrow. No regression test is needed.

Payouts due:

Christinadobrzyn commented 2 weeks ago

Paid this out - closing.