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.78k forks source link

[HOLD for payment 2023-08-28] [$1000] IOU - LAK currency is not displayed correctly inside the badge #23235

Closed lanitochka17 closed 1 year ago

lanitochka17 commented 1 year 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!


Action Performed:

  1. Open Expensify stg app
  2. Click the FAB button
  3. Click on "Split bill"
  4. Click on the currency
  5. Select "LAK-LAK" from the list of currencies
  6. Enter any 8 digit number
  7. Click on the "Next" button
  8. Selects any 2 contacts
  9. Press the "Next" button
  10. Click on the "Split {Currency}{Amount}" button

Expected Result:

The amount in LAK currency on the badge is displayed correctly and is equal to the amount owed by the participant

Actual Result:

The amount in LAK currency on the badge is displayed incorrectly, the last two digits of the amount owed are missing

Workaround:

Unknown

Platforms:

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

Version Number: 1.3.43.0

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

https://github.com/Expensify/App/assets/78819774/57eca6a8-6448-400b-bc12-b9fd547ccf85

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0110273979413679a9
  • Upwork Job ID: 1683641607558184960
  • Last Price Increase: 2023-08-01
melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

BhuvaneshPatil commented 1 year ago

The problem needs to be solved from backend. This problem is with another currencies as well. Ex - LBP.

The property coming from backend, ie. lastMessageText and lastMessageHTML is calculated wrong

melvin-bot[bot] commented 1 year ago

Job added to Upwork: https://www.upwork.com/jobs/~0110273979413679a9

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

sophiepintoraetz commented 1 year ago
image

Assigning @sobitneupane to confirm that this is a backend issue!

sobitneupane commented 1 year ago

@sophiepintoraetz It looks like a backend issue to me as well. It works fine in offline mode but as soon as connected to internet it changes to the wrong value. I believe it is due to some response from the backend.

https://github.com/Expensify/App/assets/25876548/bea8c2b3-48bf-413c-95ac-7009f9188c3e

melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @aldo-expensify (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

aldo-expensify commented 1 year ago

I didn't have time to investigate this today, I'll try early next week.

sophiepintoraetz commented 1 year ago

@aldo-expensify - hopefully this week?

aldo-expensify commented 1 year ago

This is possibly because of:

Some code was added here changing the formatting used for IOU in the backend, but we didn't do anything in the App code to be consistent. This also makes more spread the code handling decimals in the backend. In the past this lived only in PHP-Libs https://github.com/Expensify/PHP-Libs/blob/main/src/CurrencyInfo.php.

I have already an issue for this: https://github.com/Expensify/Expensify/issues/300539

I'll try to give it time later during the week so we can get it done. Meanwhile, I think we can remove the help wanted and make it a weekly?

melvin-bot[bot] commented 1 year ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] commented 1 year ago

@sobitneupane @sophiepintoraetz @aldo-expensify 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!

aldo-expensify commented 1 year ago

Removing Help Wanted for now as this is most likely a backend problem

melvin-bot[bot] commented 1 year ago

Current assignee @sobitneupane is eligible for the Internal assigner, not assigning anyone new.

aldo-expensify commented 1 year ago

I don't think this is happening anymore

https://github.com/Expensify/App/assets/87341702/8c9cebb3-f73d-4337-9b38-dee1e76c27dd

and with a bigger number 12345678:

image
aldo-expensify commented 1 year ago

This feels like a duplicate of https://github.com/Expensify/App/issues/19792 and it was solved when the solution for that ones deployed I think.

aldo-expensify commented 1 year ago

Oops, I think I was having problems with my dev env and this is not working really! reopening to keep investigating

aldo-expensify commented 1 year ago

Confirmed that this bug still exists:

image
aldo-expensify commented 1 year ago

The frontend seems to be sending an incorrect amount to the backend. The amount should be in "cents" (1/100 subunit) independent of the currency used.

Creating a money request of 100 USD (2 decimals currency), should send an mount of 10,000 to the backend Creating a money request of 100 LAK (0 decimals currency), should send an mount of 10,000 to the backend

image

In the screenshot above, the expected amount was 1234567800, but it wasn't multiplied by 100

aldo-expensify commented 1 year ago

Frontend PR up: https://github.com/Expensify/App/pull/24175 Taking videos/screenshots

aldo-expensify commented 1 year ago

I wasn't able to finish, my PR is causing a regression described here: https://github.com/Expensify/App/pull/24175#issuecomment-1666333579

I'll continue on Tuesday 👋

aldo-expensify commented 1 year ago

Didn't continue on Tuesday, but I finished the code for https://github.com/Expensify/App/pull/24175 today. I just have to complete the testing steps and provide more screenshots, then I'll make it ready for review.

aldo-expensify commented 1 year ago

I made the PR ready for review today.

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.55-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-08-28. :confetti_ball:

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

melvin-bot[bot] commented 1 year ago

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:

sophiepintoraetz commented 1 year ago

@sobitneupane - can you put in a request for $1000 once you have completed the checklist above?

sophiepintoraetz commented 1 year ago

Bump @sobitneupane

sobitneupane commented 1 year ago

Sorry for the delay. I will try to get to it by tomorrow EOD.

aldo-expensify commented 1 year ago

Bump @sobitneupane

sophiepintoraetz commented 1 year ago

Closing in the meantime - seeing as the action is with @sobitneupane and the request summary is here.

sobitneupane commented 1 year ago

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:

I think this issue was caused by some backend change as suggested here

sobitneupane commented 1 year ago

Regression Test Proposal:

  1. Create money requests in currencies that have decimals and currencies without decimals, for example:

    • BHD: 3 decimals, the third decimal will be truncated because we can't store it in the database, but it still should display with 3 decimal places after the . (the third decimal will always be a 0)
    • JPY: 0 decimals
    • VND: 0 decimals
    • USD: 2 decimals
    • RSD: 2 decimals (special case, should be tested)
  2. Verify that preview looks correctly formatted in chat report and in LHN.

Do we agree 👍 or 👎

sobitneupane commented 1 year ago

Requested payment on newDot.

https://github.com/Expensify/App/issues/23235#issuecomment-1695016076

JmillsExpensify commented 1 year ago

$1,000 approved for payment in NewDot based on this BZ comment.