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-05-20] [$125] Workspace - Impossible to change workspace currency #39435

Closed
5 of 6 tasks
izarutskaya opened this issue Apr 2, 2024 · 25 comments
Closed
5 of 6 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Apr 2, 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: v1.4.59-0
Reproducible in staging?: Y
Reproducible in production?: Y
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

Precondition: User is logged in ND. We should try to change name of already existing workspaces only.

  1. Go to workspace profile.
  2. Click on 'Default currency' > select any another currency

Expected Result:

Workspace currency is changed to newly selected.

Actual Result:

Workspace currency is not changed to newly selected.

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

Bug6434244_1711976790758.ws_currency_change.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d779d698f27e25f6
  • Upwork Job ID: 1775310934472347648
  • Last Price Increase: 2024-05-20
  • Automatic offers:
    • alitoshmatov | Contributor | 0
Issue OwnerCurrent Issue Owner: @kadiealexander
@izarutskaya izarutskaya added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

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

Copy link

melvin-bot bot commented Apr 2, 2024

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Apr 2, 2024
Copy link
Contributor

github-actions bot commented Apr 2, 2024

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

@izarutskaya
Copy link
Author

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

@izarutskaya
Copy link
Author

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

@izarutskaya izarutskaya removed the DeployBlockerCash This issue or pull request should block deployment label Apr 2, 2024
@abzokhattab
Copy link
Contributor

I think its related to this issue:

#38928

@kadiealexander kadiealexander added Daily KSv2 and removed Hourly KSv2 labels Apr 2, 2024
@marcochavezf
Copy link
Contributor

Seems this can be fixed externally

@marcochavezf marcochavezf added the External Added to denote the issue can be worked on by a contributor label Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

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

@melvin-bot melvin-bot bot changed the title Workspace - Impossible to change workspace currency [$500] Workspace - Impossible to change workspace currency Apr 2, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

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

@abzokhattab
Copy link
Contributor

i am no longer able to reproduce it on main .. is it still reproducible?

@neonbhai
Copy link
Contributor

neonbhai commented Apr 3, 2024

Agree with @abzokhattab, cannot reproduce on latest main:

Screen.Recording.2024-04-03.at.5.28.52.AM.mov

@hungvu193
Copy link
Contributor

Issue is reproducible on latest main.

Screen.Recording.2024-04-03.at.10.06.47.mov

@abzokhattab
Copy link
Contributor

abzokhattab commented Apr 3, 2024

Proposal

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

User is unable to change workspace currency while the policy distance rate is not loaded

What is the root cause of that problem?

The currency of the workspace cannot be changed because in the updateGeneralSettings function, it returns if the customUnitID is undefined. This ID is retrieved from policy?.customUnits, which is only loaded when the user accesses the distance rates page here.

if (!policy || !customUnitID) {

Consequently, if the user attempts to change the workspace currency without having opened this page, the issue arises.

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

we can remove the || !customUnitID check:

    if (!policy)

then to fix the typescript error in the optimistic, success and failure data we need to make sure that the customUnitID var is not undefined before modifying the customUnits property

  1. change this to:
    ...(customUnitID && {
                    customUnits: {
                        [customUnitID]: {
                            ...distanceUnit,
                            rates: optimisticRates,
                        },
                    },
                }),
  1. and here to:
               ...(customUnitID && {
                    customUnits: {
                        [customUnitID]: {
                            rates: finallyRates,
                        },
                    },
                }),
  1. also here to:
               ...(customUnitID && {
                    customUnits: {
                        [customUnitID]: {
                            rates: failureRates,
                        },
                    },
                }),

This way we will always be able to update the currency even when the distance rates are not available.

FYI: If the user is offline and the distance rates are unavailable, and they change the currency, we do not update the distance rate according to the change mentioned above. This is acceptable because, when the user goes online and retrieves all the distance rates, they will be having the updated currency from the backend in this case.

@abzokhattab
Copy link
Contributor

abzokhattab commented Apr 3, 2024

@hungvu193 Correct. The issue occurs with workspaces that don't have the distance rates data loaded.

@abzokhattab
Copy link
Contributor

Updated the RCA in my proposal, the solution is the same though.

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

melvin-bot bot commented Apr 3, 2024

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

@mountiny
Copy link
Contributor

mountiny commented Apr 3, 2024

This seems to be regression from this PR @MrMuzyk could you please address this issue? Thank you 🙇

If we end up using solution from the proposals, lets pay $125 for their help.

Assigning @alitoshmatov as reviewer on the offending PR

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Apr 3, 2024
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Apr 26, 2024
Copy link

melvin-bot bot commented Apr 26, 2024

This issue has not been updated in over 15 days. @mountiny, @kadiealexander, @alitoshmatov eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@alitoshmatov
Copy link
Contributor

This was fixed in follow up PR. We can close this

@abzokhattab
Copy link
Contributor

abzokhattab commented Apr 29, 2024

If we end up using solution from the proposals, lets pay $125 for their help.

I see that the changes are the same as in my proposal. just reminding you about the bounty as @mountiny stated here. thanks

@abzokhattab
Copy link
Contributor

Kind reminder on this

@mountiny mountiny added Daily KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review Monthly KSv2 labels May 20, 2024
@melvin-bot melvin-bot bot added the Overdue label May 20, 2024
@mountiny
Copy link
Contributor

$125 to @abzokhattab for their help cc @kadiealexander

@melvin-bot melvin-bot bot removed the Overdue label May 20, 2024
@mountiny mountiny changed the title [$500] Workspace - Impossible to change workspace currency [HOLD for payment 2024-05-20] [$500] Workspace - Impossible to change workspace currency May 20, 2024
@mountiny mountiny changed the title [HOLD for payment 2024-05-20] [$500] Workspace - Impossible to change workspace currency [HOLD for payment 2024-05-20] [$125] Workspace - Impossible to change workspace currency May 20, 2024
Copy link

melvin-bot bot commented May 20, 2024

Upwork job price has been updated to $125

@kadiealexander
Copy link
Contributor

kadiealexander commented May 21, 2024

Payouts due:

Upwork job is here.

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants