Skip to content

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

Closed

Description

@m-natarajan

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.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

Activity

  1. added
    Daily
    Bug
    on Aug 5, 2024
  2. melvin-bot commented on Aug 5, 2024

    @melvin-bot

    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.

  3. nyomanjyotisa commented on Aug 6, 2024

    @nyomanjyotisa
    Member

    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;
    
  4. paultsimura commented on Aug 6, 2024

    @paultsimura
    Contributor

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

  5. added
    External
    on Aug 8, 2024
  6. changed the title [-]Distance Rate: incorrect currency for p2p request (beta)[/-] [+][$250] Distance Rate: incorrect currency for p2p request (beta)[/+] on Aug 8, 2024
  7. melvin-bot commented on Aug 8, 2024

    @melvin-bot
  8. added
    Help Wanted
    on Aug 8, 2024
  9. melvin-bot commented on Aug 8, 2024

    @melvin-bot

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

  10. 55 remaining items

  11. added
    Weekly
    Awaiting Payment
    and removed
    Weekly
    on Oct 18, 2024
  12. 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[/+] on Oct 18, 2024
  13. removed
    Reviewing
    on Oct 18, 2024
  14. melvin-bot commented on Oct 18, 2024

    @melvin-bot

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

  15. melvin-bot commented on Oct 18, 2024

    @melvin-bot

    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:

  16. melvin-bot commented on Oct 18, 2024

    @melvin-bot

    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:
  17. paultsimura commented on Oct 21, 2024

    @paultsimura
    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 👎

  18. added
    Daily
    and removed
    Weekly
    on Oct 25, 2024
  19. stephanieelliott commented on Oct 26, 2024

    @stephanieelliott
    Contributor
  20. stephanieelliott commented on Oct 26, 2024

    @stephanieelliott
    Contributor

    Summarizing payment on this issue:

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

  21. melvin-bot commented on Oct 26, 2024

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions