Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2024-10-25] [$250][P2P Distance] Rate currency doesn't match expense currency #46844

Closed
6 of 7 tasks
m-natarajan opened this issue Aug 5, 2024 · 39 comments
Closed
6 of 7 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@m-natarajan
Copy link

m-natarajan commented Aug 5, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.16-5
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @paultsimura
Initial slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1722875886722249

Additional in depth conversation and conclusion

Action Performed:

  1. User A uses EUR/km as currency and mileage unit
  2. User B uses USD/miles
  3. User A submits a distance expense to User B

Expected Result:

Show the rate in the original currency of the expense for both users, to match the fact that we use the original currency for the amount.

Also, some general notes:

  • The currency of the IOU report is the reporting currency of the user that’s owed
  • Transaction threads/individual expense views show amounts in the original currency they were requested in
  • The only way a user can see the original currency vs the reporting currency for the amount, is when there is one expense on the report, in which case the reporting currency is used for the report total and it’s easy to see in comparison to the expense currency.

Note: The distance rate (mi or km) is being handled separately in this issue

Actual Result:

User B sees the rate in USD without it being converted at all, so it’s inaccurate.

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

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

Screenshots/Videos

Single expense report preview
User A
 a-preview

User B
b-preview

Expense view
User A
a-expense

User B
b-expense

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fb1bf8d2bf2fb7c7
  • Upwork Job ID: 1821378352686653817
  • Last Price Increase: 2024-10-01
  • Automatic offers:
    • paultsimura | Contributor | 103443192
    • nyomanjyotisa | Contributor | 104234962
Issue OwnerCurrent Issue Owner: @stephanieelliott
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 5, 2024
Copy link

melvin-bot bot commented Aug 5, 2024

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

@nyomanjyotisa
Copy link
Contributor

Proposal

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

incorrect currency for p2p request

What is the root cause of that problem?

We get the currency from the personal policy output currency here

const currency = policy ? policy.outputCurrency : PolicyUtils.getPersonalPolicy()?.outputCurrency ?? CONST.CURRENCY.USD;

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

Get the currency from the transaction data first

const currency = transaction?.currency ?? policy?.outputCurrency ?? PolicyUtils.getPersonalPolicy()?.outputCurrency ?? CONST.CURRENCY.USD;

What alternative solutions did you explore? (Optional)

Or just this:

const currency = transaction?.currency;

Or:

const currency = transaction?.currency ?? CONST.CURRENCY.USD;

@paultsimura
Copy link
Contributor

I'd love to be C+ here as I've reported the bug and have been working tightly with the Distance expenses recently.

@stephanieelliott stephanieelliott added the External Added to denote the issue can be worked on by a contributor label Aug 8, 2024
@melvin-bot melvin-bot bot changed the title Distance Rate: incorrect currency for p2p request (beta) [$250] Distance Rate: incorrect currency for p2p request (beta) Aug 8, 2024
Copy link

melvin-bot bot commented Aug 8, 2024

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

@melvin-bot melvin-bot bot added Overdue Help Wanted Apply this label when an issue is open to proposals by contributors labels Aug 8, 2024
Copy link

melvin-bot bot commented Aug 8, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Aug 8, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 8, 2024
Copy link

melvin-bot bot commented Aug 8, 2024

📣 @paultsimura 🎉 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 📖

@stephanieelliott stephanieelliott added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 8, 2024
@stephanieelliott
Copy link
Contributor

Sure, all yours @paultsimura -- I've assigned you as C+!

@thesahindia
Copy link
Member

Just a note: C+ can't request to be assigned because they have reported the issue (which was discussed). This is for fairness.

@paultsimura
Copy link
Contributor

Sorry @thesahindia I was unaware of that discussion. Please take this issue back, it would be fair👍

@thesahindia
Copy link
Member

thesahindia commented Aug 8, 2024

No problem! I don't have any issue here. Feel free to take it.

I was just adding a note for awareness.

@paultsimura
Copy link
Contributor

This issue should cover the mileage issue as well.
What should we do when user A uses kilometers, and user B – miles?

a: Convert kilometers to miles and show the corresponding value in each user's mileage preference
b: Show the original distance & mileage unit for both users

@stephanieelliott @neil-marcellini

@neil-marcellini
Copy link
Contributor

Wow this is an interesting one. I think ideally each user will see it based on their own preferences. So if A is in EUR/km and B is in USD/mi, then both alway sees the values in their units.

However, I'm not sure if our system is going to support that very well right now. It would be helpful to know what happens with IOUs if two users create manual expenses with different currencies. We will probably want to follow that pattern.

@paultsimura would you please do that investigation and then make a post asking about the UX for this situation in #expensify-open-source? I will then share it with our internal team and we can all agree on what's best. It feels somewhat important and something we haven't considered much so I want to get a good amount of feedback.

@melvin-bot melvin-bot bot added the Overdue label Aug 12, 2024
@paultsimura
Copy link
Contributor

The discussion is still in progress: https://expensify.slack.com/archives/C01GTK53T8Q/p1723152837593809

@melvin-bot melvin-bot bot removed the Overdue label Aug 12, 2024
@neil-marcellini neil-marcellini changed the title [$250] Distance Rate: incorrect currency for p2p request (beta) [$250][P2P Distance] Rate: incorrect currency for p2p request (beta) Aug 13, 2024
@neil-marcellini neil-marcellini self-assigned this Aug 14, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 2, 2024
Copy link

melvin-bot bot commented Oct 2, 2024

📣 @nyomanjyotisa 🎉 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 📖

@stephanieelliott
Copy link
Contributor

PR is still under active review

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 9, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 18, 2024
@melvin-bot melvin-bot bot changed the title [$250][P2P Distance] Rate currency doesn't match expense currency [HOLD for payment 2024-10-25] [$250][P2P Distance] Rate currency doesn't match expense currency Oct 18, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 18, 2024
Copy link

melvin-bot bot commented Oct 18, 2024

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

Copy link

melvin-bot bot commented Oct 18, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.50-8 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-10-25. 🎊

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

Copy link

melvin-bot bot commented Oct 18, 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:

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

@paultsimura
Copy link
Contributor

Note

I wouldn't call this a bug with an offending PR – this is rather a follow-up after #38543, covering a specific multi-currency edge case and improving UX with the rates selection.

  • The PR that introduced the bug has been identified. Link to the PR: Feat/36985 create new rate field #38543
  • 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: N/A (see the Note)
  • 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: N/A
  • Determine if we should create a regression test for this bug: Yes
  • 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.

Regression Test Proposal

Pre-requisites:
Have 2 accounts with different personal currencies. For this:

  1. Log in to OD as User A
  2. Go to Settings > Workspaces > Individual
  3. Select your personal workspace
  4. Select "Reports" from the left menu
  5. Change the report currency to EUR
  6. For User B, keep the default currency (e.g. USD)

Test 1:

  1. Login as User A and User B to ND on different devices;
  2. As User A, submit a Distance request to User B
  3. As User A, navigate to the created request details
  4. Verify its amount and rate are displayed in EUR
  5. As User B, navigate to the same distance request details
  6. Verify its amount and rate are displayed in EUR
  7. As User B, submit a Distance request to User A
  8. As User B, navigate to the created request details
  9. Verify its amount and rate are displayed in USD
  10. As User A, navigate to the same distance request details
  11. Verify its amount and rate are displayed in USD

Test 2:

  1. Submit a Distance request
  2. Navigate to the created request details
  3. Verify its rate is displayed as the selected policy currency
  4. Go to the workspace setting and change the default currency to another currency (e.g. EUR)
  5. Navigate to the created request details
  6. Click on the "Rate" field
  7. Verify that the rate shown in the "Rate" field matches the rate displayed in the "Selected Rate" modal

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 25, 2024
@stephanieelliott
Copy link
Contributor

Regression test created: https://github.com/Expensify/Expensify/issues/439138

@stephanieelliott
Copy link
Contributor

Summarizing payment on this issue:

Upwork job is here: https://www.upwork.com/jobs/~01fb1bf8d2bf2fb7c7

Copy link

melvin-bot bot commented Oct 26, 2024

@neil-marcellini @stephanieelliott Be sure to fill out the Contact List!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants