Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.36k stars 2.79k forks source link

[$250] Inconsistent Currency Code Representation for 'MRO' in LHN #46392

Closed lanitochka17 closed 1 week ago

lanitochka17 commented 2 months ago

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.13-3 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers): betlihemasfaw14@gmail.com Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to Account Settings > Workspace
  2. Change the default currency to 'MRO' in Profile
  3. In the LHN, go to Workspace Chat > Plus Sign > Expense Request
  4. Add a merchant and confirm it
  5. Go to IOU and observe the LHN

Expected Result:

The currency code should be consistently represented as 'MRO' throughout the app

Actual Result:

The currency code is inconsistently represented as 'UM' instead of 'MRO' when submitting an expense and viewing the IOU in LHN

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/52b0ef9f-605d-41f3-82a7-de78213a9477

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019389c6893f847c12
  • Upwork Job ID: 1817710932397878288
  • Last Price Increase: 2024-08-04
Issue OwnerCurrent Issue Owner: @mollfpr
melvin-bot[bot] commented 2 months ago

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

lanitochka17 commented 2 months ago

@jliexpensify FYI 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

melvin-bot[bot] commented 2 months ago

Job added to Upwork: https://www.upwork.com/jobs/~019389c6893f847c12

melvin-bot[bot] commented 2 months ago

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

daledah commented 2 months ago

Proposal

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

The currency code is inconsistently represented as 'UM' instead of 'MRO' when submitting an expense and viewing the IOU in LHN

What is the root cause of that problem?

The polifill for Intl.NumberFormat we're using does not have the correct symbol value of MRO, example in https://github.com/formatjs/formatjs/blob/f71ce48aaf8ada6a77d393d3f2293fc14f2c38c2/packages/intl-numberformat/test262-main.ts#L1019.

Perhaps it's because MRO is a retired currency and no longer in use since 2018, so no longer actively supported. Meanwhile back-end library still returns currency symbol as MU, hence the inconsistency.

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

Remove the retired currencies from the list of currencies in the app, namely here https://github.com/Expensify/App/blob/main/tests/unit/currencyList.json#L1 and here https://github.com/Expensify/App/blob/98d8a5ae4bb52539669f79e007246417eb8c8f1e/src/CONST.ts#L4512 because no user will use it (or should be allowed to use it)

Or, do not remove the currency completely but filtering out the retired currencies when displaying select options for the user (like in the currency list for submitting expense), this will allow user to view retired currencies in legacy reports/transactions, but not able to create new reports/transactions with retired currencies.

We can also hide it only if the retired currency is not currently selected (if it's already selected in previous requests, the user should be able to view the (maybe disabled) selection when clicking on the currency button, if the user selects another currency however, they won't be able to select the retired currency again.

What alternative solutions did you explore? (Optional)

Another solution could be that: Replace the currency formatting logic in the front-end by whatever is used in the back-end, so they are consistent.

melvin-bot[bot] commented 2 months ago

@mollfpr, @jliexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

mollfpr commented 2 months ago

Will review the proposal in the morning!

jliexpensify commented 1 month ago

Thank you @mollfpr

melvin-bot[bot] commented 1 month ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

mollfpr commented 1 month ago

This issue is on the BE where it returns the lastMessageHtml or lastMessageText with UM currency. As mentioned in the proposal the currency MRU is also set as UM in the LHN's last message but the exchange is different between MRO and MRU.

@jliexpensify We might need an internal engineer to check why the report sends a different currency for the lastMessageHtml and lastMessageText values.

daledah commented 1 month ago

@mollfpr The back-end returned data is correct. UM is the symbol representation of MRO (the code here).

UM in lastMessageHtml or lastMessageText is correct, just like $ is used in those places instead of USD.

The bug is in the front-end as explained in my proposal, it should show UM throughout just like $ is shown around the app.

mollfpr commented 1 month ago

Okay, I understand now. It's correct that MRO is obsolete.

Screenshot 2024-08-05 at 19 40 53

The currency code is inconsistently represented as 'UM' instead of 'MRO' when submitting an expense and viewing the IOU in LHN

@daledah @jliexpensify I think the actual result is expected where UM is a symbol representing currency MRO.

jliexpensify commented 1 month ago

Thanks for the investigation @mollfpr - if MRO is now obsolete, could we just change it to MRU or even UM in-product? I think if we can get rid of the inconsistency, that would be good.

if it's not something that can be fixed, then we can close this one.

daledah commented 1 month ago

I think if we can get rid of the inconsistency, that would be good.

@jliexpensify The inconsistency can be fixed in the front-end using my proposal (both main and alternative solution)

@mollfpr Could you kindly review the proposal? Thx!

mollfpr commented 1 month ago

if MRO is now obsolete, could we just change it to MRU or even UM in-product? I think if we can get rid of the inconsistency, that would be good.

@jliexpensify We can filter out the obsolete currencies mentioned in the @daledah proposal.

jliexpensify commented 1 month ago

Ok, I think we could probably fix this then? @mollfpr want to push it forward and we'll get an Internal Engineer to make the final decision?

mollfpr commented 1 month ago

The actual issue here is expected that UM is the symbol for MRO currency, but it's mentioned in the @daledah proposal we have obsolete currency (including MRO which replace by MRU) I think it's a better chance to filter them out from the list.

๐ŸŽ€ ๐Ÿ‘€ ๐ŸŽ€ C+ reviewed!

melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @youssef-lr, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] commented 1 month ago

@youssef-lr @mollfpr @jliexpensify this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

jliexpensify commented 1 month ago

Bumping @youssef-lr to review proposal, thanks!

melvin-bot[bot] commented 1 month ago

@youssef-lr, @mollfpr, @jliexpensify Eep! 4 days overdue now. Issues have feelings too...

jliexpensify commented 1 month ago

Bumping @youssef-lr to review the proposal, cheers!

melvin-bot[bot] commented 1 month ago

@youssef-lr, @mollfpr, @jliexpensify Still overdue 6 days?! Let's take care of this!

jliexpensify commented 1 month ago

DM-ed Youssef for a review.

melvin-bot[bot] commented 1 month ago

๐Ÿ“ฃ @daledah You have been assigned to this job! Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review ๐Ÿง‘โ€๐Ÿ’ป Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs! Keep in mind: Code of Conduct | Contributing ๐Ÿ“–

daledah commented 1 month ago

@mollfpr This PR is ready for review.

melvin-bot[bot] commented 2 weeks ago

This issue has not been updated in over 15 days. @youssef-lr, @mollfpr, @jliexpensify, @daledah 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!

jliexpensify commented 2 weeks ago

Checked PR, this is deployed to staging but not to prod.

mollfpr commented 1 week ago

@jliexpensify The PR is deployed to production 3 weeks ago. I think Melvin failed to send the notification. https://github.com/Expensify/App/issues/48035

Screenshot 2024-09-18 at 15 22 50

mollfpr commented 1 week ago

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

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

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

  1. Select FAB > Submit expense 2 .Open Select currency list
  2. Verify that: Retired currencies (such as MRO) is not shown anymore
  3. ๐Ÿ‘ or ๐Ÿ‘Ž
jliexpensify commented 1 week ago

Dang ok - thanks @mollfpr!

jliexpensify commented 1 week ago

Payment Summary

Upworks job - https://www.upwork.com/jobs/~021836326350630574505

daledah commented 1 week ago

Hey @jliexpensify here's my Upwork profile link https://www.upwork.com/freelancers/~0138d999529f34d33f

TIA

jliexpensify commented 1 week ago

Thanks @daledah - offer sent

garrettmknight commented 1 week ago

$250 approved for @mollfpr

jliexpensify commented 1 week ago

Paid and job closed!