Skip to content

[HOLD for payment 2023-10-10] [HOLD for payment 2023-10-09] [$1000] Web - Request money - Request confirmation link automatically changes request money currency to USD #24393

Closed

Description

@izarutskaya

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

Precondition: Your default currency should not be USD when you click on request money

  1. Open the app
  2. Click on plus and click on request money
  3. Enter any amount and continue, select any user and continue
  4. Copy the URL, link should look like: https://staging.new.expensify.com/request/new/confirmation/
  5. Logout and paste the URL
  6. Login and observe that now currency is changed to USD even though your default currency is different and was not changed during last request

Expected Result:

App should display default currency of user in request money when we open confirmation link on login

Actual Result:

App displays USD as currency in request money when we open confirmation link on login

Workaround:

unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.53-1

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

Notes/Photos/Videos: Any additional supporting documentation

currency.changes.to.USD.in.confirmation.link.mp4
Recording.1164.mp4

Expensify/Expensify Issue URL:

Issue reported by: @dhanashree-sawant

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691057407426539

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01aad4c8cddaf2f5c5
  • Upwork Job ID: 1691154081471135744
  • Last Price Increase: 2023-08-21
  • Automatic offers:
    • tienifr | Contributor | 26271380

Activity

  1. added
    Daily
    Bug
    on Aug 10, 2023
  2. melvin-bot commented on Aug 10, 2023

    @melvin-bot

    Triggered auto assignment to @sonialiap (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. melvin-bot commented on Aug 10, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  4. ygshbht commented on Aug 10, 2023

    @ygshbht
    Contributor

    Proposal

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

    Upon refreshing the Request Money confirmation link, the displayed currency defaults to USD regardless of the user's set default currency.

    What is the root cause of that problem?

    The default currency for IOUs is USD. When the user initiates the Request Money flow, the currency is updated based on the currentUserPersonalDetails when the resetMoneyRequestInfo function is invoked. However, when the user refreshes the page, the personal details have not yet been set and the function responsible for updating this, which is triggered by FAB -> Request Money, isn't called. As a result, the app falls back to the default IOU currency, USD.

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

    Update

    1. We need to ensure that IOU.currency is in sync with currentUserPersonalDetails.currency. We can listen to changes in currentUserPersonalDetails.currency and update IOU.currency accordingly if user has logged in the session. So instead of directly getting iou

      iou: {key: ONYXKEYS.IOU},

      we can create a hook withIOU where we listen for such changes and update the iou accordingly

    2. UseEffect Approach: In the NewRequestAmountPage, use a useEffect hook to call resetMoneyRequestInfo or only update currency when the component mounts/ currentUserPersonalDetails.currency updates if navigateToNextPage hasn't been called yet and user has signed in in the session. This ensures that even if the page is refreshed, the correct default currency is always displayed.

    What alternative solutions did you explore? (Optional)

    1. Global Approach: A more global solution would be to invoke the resetMoneyRequestInfo/ currency change function at a higher-level component that mounts when the user logs in and once the currentUserPersonalDetails have been received. This ensures that the default currency is always in sync whenever the user logs in.
    2. URL Storage: Store the currency in the URL itself. This means that regardless of any refreshing or subsequent navigation, the currency remains persistent as it's directly encoded in the URL.
      Example URL: https://staging.new.expensify.com/request/new/confirmation/?currency=INR
    3. Modify Reset Conditions: Update the shouldReset condition in the NewRequestAmountPage to account for situations where the page might be refreshed, ensuring the correct currency is displayed.
      if (shouldReset) {
      IOU.resetMoneyRequestInfo(moneyRequestID);
      }

    I'd choose URL storage for IOU urls as the preferred solution as it seems to present no drawbacks while others could due to the way the app is configured

    Other areas facing this issue, could also use a similar approach

  5. sonialiap commented on Aug 14, 2023

    @sonialiap
    Contributor

    I think we can simplify the reproduction steps a bit:

    1. Log into an account and set the currency to something not USD (ex: EUR)
    2. Click on the FAB > Request Money
    3. Confirm the OUI screen shows the default currency (ex: EUR). Exit IOU set up without saving
    4. Click on https://staging.new.expensify.com/request/new/confirmation/
    5. Confirm that the OUI screen shows USD instead of your default currency
  6. added
    External
    on Aug 14, 2023
  7. changed the title [-]Web - Request money - Request confirmation link automatically changes request money currency to USD[/-] [+][$1000] Web - Request money - Request confirmation link automatically changes request money currency to USD[/+] on Aug 14, 2023
  8. melvin-bot commented on Aug 14, 2023

    @melvin-bot
  9. added
    Help Wanted
    on Aug 14, 2023
  10. melvin-bot commented on Aug 14, 2023

    @melvin-bot

    Current assignee @sonialiap is eligible for the External assigner, not assigning anyone new.

  11. 79 remaining items

  12. sonialiap commented on Oct 23, 2023

    @sonialiap
    Contributor

    I've submitted a refund request to @tienifr and updated the amounts in comment #24393 (comment)

  13. sonialiap commented on Oct 23, 2023

    @sonialiap
    Contributor

    @allroundexperts please make a request in ND for $500

  14. allroundexperts commented on Oct 23, 2023

    @allroundexperts
    Contributor

    All done @sonialiap!

  15. JmillsExpensify commented on Oct 24, 2023

    @JmillsExpensify
    Contributor

    $500 payment approved for @allroundexperts based on comment above.

  16. melvin-bot commented on Oct 27, 2023

    @melvin-bot

    @anmurali, @sonialiap, @cristipaval, @allroundexperts, @tienifr Whoops! This issue is 2 days overdue. Let's get this updated quick!

  17. cristipaval commented on Oct 27, 2023

    @cristipaval
    Contributor

    Are we good to close this one, @sonialiap?

  18. sonialiap commented on Oct 30, 2023

    @sonialiap
    Contributor

    The last remaining step is following up on the refund. But I can sort that out with the issue being closed. Closing

  19. tienifr commented on Nov 1, 2023

    @tienifr
    Contributor

    I've submitted a refund request to @tienifr and updated the amounts in comment #24393 (comment)

    @sonialiap I've refunded, thanks!

  20. sonialiap commented on Nov 3, 2023

    @sonialiap
    Contributor

    Thanks, @tienifr 🙇

    image
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