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.98k stars 2.98k forks source link

fix: reverting the amount and currency after error clearance. #55102

Closed Tony-MK closed 3 days ago

Tony-MK commented 2 weeks ago

Explanation of Change

After the error message is cleared, change the transaction amount and currency to the values used to pay.

Fixed Issues

$ https://github.com/Expensify/App/issues/54471 PROPOSAL: https://github.com/Expensify/App/issues/54471#issuecomment-2560220812

Tests

  1. Create an expense from user A to user B.
  2. Edit the amount of the expense.
  3. Pay the expense from user B.
  4. Click to save.
  5. Check that an error has appeared.
  6. Close the error.
  7. Confirm that the amount has changed back to the paid amount.

Offline tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

Same as tests

PR Author Checklist

Screenshots/Videos

Android: Native [Android - Native.webm](https://github.com/user-attachments/assets/43892741-2c99-4045-b511-a9b3426e4597)
Android: mWeb Chrome [Android - mWeb.webm](https://github.com/user-attachments/assets/9e5beb02-63f4-4e5d-bc9c-5898f7a9ff5d)
iOS: Native https://github.com/user-attachments/assets/37c758fd-8622-4a8c-a320-24eae5608aa0
iOS: mWeb Safari https://github.com/user-attachments/assets/3674c37e-374c-4e23-8c56-1cb36b45bd0b
MacOS: Chrome / Safari https://github.com/user-attachments/assets/b4f1c46b-fbee-41d4-980c-560d6a4ffc2d
MacOS: Desktop https://github.com/user-attachments/assets/ad6a8d63-f499-4bfa-81f5-1182eb72a16e
melvin-bot[bot] commented 2 weeks ago

@hungvu193 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

hungvu193 commented 1 week ago

Can you address the linting? @Tony-MK

hungvu193 commented 1 week ago

Do you think we also should to revert the amount when we clicked the above error?

https://github.com/user-attachments/assets/fbef07d4-9dad-41f8-b606-b8a215035dff

Tony-MK commented 1 week ago

Can you address the linting? @Tony-MK

@hungvu193, Seems like the linting issue is not due to my changes but because of rulesdir/no-default-id-values.

You can read this slack thread for more info.

hungvu193 commented 1 week ago

Can you address the linting? @Tony-MK

@hungvu193, Seems like the linting issue is not due to my changes but because of rulesdir/no-default-id-values.

You can read this slack thread for more info.

I know that. But I think you mentioned wrong slack thread. Anyway, we still need to address the linting

hungvu193 commented 1 week ago

Do you think we also should to revert the amount when we clicked the above error?

https://github.com/user-attachments/assets/fbef07d4-9dad-41f8-b606-b8a215035dff

How about this one?

Tony-MK commented 1 week ago

Can you address the linting? @Tony-MK

@hungvu193, Seems like the linting issue is not due to my changes but because of rulesdir/no-default-id-values. You can read this slack thread for more info.

I know that. But I think you mentioned wrong slack thread. Anyway, we still need to address the lining

I just wanted to point out the two first lines.

[!NOTE] Hey team, please read this section thoroughly and ensure you follow it in the PRs you write/review. The main purpose of this eslint change was to ensure we gradually start handling missing IDs properly.

Yeah, we can address the lining, but won't it cause merge conflicts with other PRs trying to fix the same lint issue?

Screenshot 2025-01-13 at 15 22 26

Do you think we also should to revert the amount when we clicked the above error?

How about this one?

Frankly, I also don't know about this one.

I have considered it and would like your opinion because I originally thought it was only the last error.

What do you think?

hungvu193 commented 1 week ago

Yeah, we can address the lining, but won't it cause merge conflicts with other PRs trying to fix the same lint issue?

No worries, I think that's simple change so it won't be a problem.

Frankly, I also don't know about this one.

I have considered it and would like your opinion because I originally thought it was only the last error.

Yep. Agree.

hungvu193 commented 1 week ago

Regarding this comment from mkzie2 I don't think I can reproduce the bug that he mentioned. Can you confirm? @Tony-MK. ty

Tony-MK commented 1 week ago

Regarding this comment from mkzie2 I don't think I can reproduce the bug that he mentioned. Can you confirm? @Tony-MK. ty

I also could not reproduce it after attempting a couple of times.

hungvu193 commented 1 week ago

Cool. Ty

hungvu193 commented 1 week ago

Can you fix lint again ๐Ÿ˜„ ?

hungvu193 commented 1 week ago

lint is still failing..

Tony-MK commented 1 week ago

Hey @hungvu193, I have edited MoneyRequestView to pass the lint, but PureReportActionItem is the only file left. I think we should allow it since it's long, hence it has a lot of functions to change. Considering some variables are named exactly as the function name, it becomes tiresome. Also, the last commit on PureReportActionItem didn't pass the lint because of one specific rule. If it's a must, can we do it in a separate PR?

hungvu193 commented 6 days ago

Considering some variables are named exactly as the function name, it

with the function/variable that have the same name, you can change its alias like this:

import {functionName as functionNameUtil} from '..'

you can reference here: https://expensify.slack.com/archives/C01GTK53T8Q/p1736838528732529

hungvu193 commented 6 days ago

Please keep in mind that we can't merge the PR without all the check passing, we will always need to address the lint anyway.

Tony-MK commented 6 days ago

Okay, on it. It should be done by the end of the day.

hungvu193 commented 4 days ago

Thanks for the updates @Tony-MK and your effort on the lint fixes. I appreciate it ๐Ÿ™‡

hungvu193 commented 4 days ago

Reviewer Checklist

Screenshots/Videos

Android: Native https://github.com/user-attachments/assets/0bf18991-3f30-463c-8952-2d200fabb3e1
Android: mWeb Chrome https://github.com/user-attachments/assets/d9032d8c-6e71-44c6-8ff1-b1a66e52896a
iOS: Native https://github.com/user-attachments/assets/c2e89024-1325-43a5-aefb-77dff0cea3de
iOS: mWeb Safari https://github.com/user-attachments/assets/71cfd520-cd90-4040-a5ec-073ef4991a7d
MacOS: Chrome / Safari https://github.com/user-attachments/assets/1acecc27-b2e7-455b-a156-8f09b129e14f
MacOS: Desktop https://github.com/user-attachments/assets/8ac1fb2b-9db8-48ab-823a-6bfdb111f51c
OSBotify commented 3 days ago

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

github-actions[bot] commented 2 days ago

๐Ÿš€ Deployed to staging by https://github.com/tylerkaraszewski in version: 9.0.89-0 ๐Ÿš€

platform result
๐Ÿค– android ๐Ÿค– success โœ…
๐Ÿ–ฅ desktop ๐Ÿ–ฅ success โœ…
๐ŸŽ iOS ๐ŸŽ success โœ…
๐Ÿ•ธ web ๐Ÿ•ธ success โœ…
๐Ÿค–๐Ÿ”„ android HybridApp ๐Ÿค–๐Ÿ”„ success โœ…
๐ŸŽ๐Ÿ”„ iOS HybridApp ๐ŸŽ๐Ÿ”„ success โœ