Skip to content

[HOLD for payment 2024-08-14] [HOLD for payment 2024-08-13] [$250] Workspace - Default currency set in workspace is not displayed in BNP while submit expense in WS chat #46727

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!


Version Number: 9.0.16-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4805490
Email or phone of affected tester (no customers): applausetester+ck0208@applause.expensifail.com
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team
Slack conversation:

Action Performed:

Precondition: Create a new expensifail account on ND site & create a new workspace

  1. Go to Workspace settings >> tap on Profile menu
  2. Set the workspace currency to something different that your local currency
  3. Navigate to the workspace chat
  4. Tap on + icon in composer
  5. Select Submit expense

Expected Result:

The same currency that is set in workspace profile settings should display in BNP while submitting expense in workspace chat

Actual Result:

User's local currency get displayed in BNP while submit expense in WS chat though user has set a different currency in WS settings

Note: Correct default currency get reflected in BNP after refreshing the workspace chat page & then selecting submit expense opetion

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

Bug6560237_1722607924664.Recording__133.mp4

Bug6560237_1722607990817!Screenshot__226_

Bug6560237_1722607983557!Screenshot__225_

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012cb00b4b68f61310
  • Upwork Job ID: 1819442698262740619
  • Last Price Increase: 2024-08-02
Issue OwnerCurrent Issue Owner: @bfitzexpensify

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Aug 2, 2024
  2. melvin-bot commented on Aug 2, 2024

    @melvin-bot

    Triggered auto assignment to @carlosmiceli (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  3. melvin-bot commented on Aug 2, 2024

    @melvin-bot

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

  4. github-actions commented on Aug 2, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. izarutskaya commented on Aug 2, 2024

    @izarutskaya
    Author

    We think this issue might be related to the #collect project.

  6. izarutskaya commented on Aug 2, 2024

    @izarutskaya
    Author

    Production

    Recording.2693.mp4
  7. bernhardoj commented on Aug 2, 2024

    @bernhardoj
    Contributor

    Proposal

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

    Default workspace currency isn't used when opening submit expense.

    What is the root cause of that problem?

    When we start a money request, we will initialize the data here, including the currency from the policy.

    useEffect(() => {
    if (transaction?.reportID === reportID) {
    return;
    }
    IOU.initMoneyRequest(reportID, policy, isFromGlobalCreate, transactionRequestType.current);
    }, [transaction, policy, reportID, iouType, isFromGlobalCreate]);

    However, policy is initially undefined and we only re-init when the reportID is different or when changing the tab.

    const resetIOUTypeIfChanged = useCallback(
    (newIOUType: IOURequestType) => {
    if (transaction?.iouRequestType === newIOUType) {
    return;
    }
    IOU.initMoneyRequest(reportID, policy, isFromGlobalCreate, newIOUType);
    },
    [policy, reportID, isFromGlobalCreate, transaction],
    );

    This is because the policy depends on the report onyx,

    export default withOnyx<IOURequestStartPageProps, IOURequestStartPageOnyxProps>({
    report: {
    key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT}${route?.params?.reportID}`,
    },
    policy: {
    key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`,
    },

    and it's a known issue if the onyx depends on another onyx as I explained in my proposal on this old issue. In our case, the report is initially undefined for the policy onyx key function.

    Weirdly, this only started to happen after #45762, specifically the PopoverMenu file changes. Before the PR, the report is still undefined for the policy key function, but the component isn't rendered until the policy is available.

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

    Even though it started to happen after #45762, the root cause is in the withOnyx. Because withOnyx is deprecated, we can just migrate IOURequestStartPage to using useOnyx which won't have the withOnyx bug.

  8. 30 remaining items

  9. changed the title [-][HOLD for payment 2024-08-13] [$250] Workspace - Default currency set in workspace is not displayed in BNP while submit expense in WS chat[/-] [+][HOLD for payment 2024-08-14] [HOLD for payment 2024-08-13] [$250] Workspace - Default currency set in workspace is not displayed in BNP while submit expense in WS chat[/+] on Aug 7, 2024
  10. melvin-bot commented on Aug 7, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.17-2 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-08-14. 🎊

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

    • @mollfpr requires payment through NewDot Manual Requests
    • @bernhardoj requires payment through NewDot Manual Requests
  11. melvin-bot commented on Aug 7, 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:

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

    @bfitzexpensify
    Contributor

    Payment summary:

    @mollfpr to be paid $250 for C+ work via manual request
    @bernhardoj to be paid $250 for contributor work via manual request

  13. bernhardoj commented on Aug 13, 2024

    @bernhardoj
    Contributor

    Requested in ND.

  14. melvin-bot commented on Aug 14, 2024

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@bfitzexpensify)

    • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1819442698262740619/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  15. JmillsExpensify commented on Aug 14, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  16. mollfpr commented on Aug 14, 2024

    @mollfpr
    Contributor

    [@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
    [@mollfpr] 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:

    I couldn't find the offending PR.

    [@mollfpr] 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:

    The regression step should be good.

    [@mollfpr] Determine if we should create a regression test for this bug.
    [@mollfpr] 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.

    Prerequisite:
    Go to Workspace settings and set the workspace currency to something different than your local currency

    1. Navigate to the workspace chat
    2. Tap on the + icon in the composer
    3. Select Submit expense
    4. Verify the currency shown is the workspace currency
    5. 👍 or 👎
  17. bfitzexpensify commented on Aug 15, 2024

    @bfitzexpensify
    Contributor

    Works for me! Proposed in https://github.com/Expensify/Expensify/issues/420653. Closing this out

  18. JmillsExpensify commented on Aug 20, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @mollfpr

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.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions