-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$500] Expense - Expense preview shows incorrect amount briefly when WS default currency is different #31638
Comments
Job added to Upwork: https://www.upwork.com/jobs/~015cbb737be93fbffb |
Triggered auto assignment to @NicMendonca ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @c3024 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Expense preview shows incorrect amount briefly when WS default currency is different What is the root cause of that problem?The cause of the problem is our optimistic data. We are incrementing the raw value in the default currency to the Lines 467 to 468 in a722235
and then that iouReport.total value is getting displayed in the report preview with the workspace currency until the real data (value converted to the workspace currency) comes from BE.
What changes do you think we should make in order to solve the problem?If it is possible to convert currencies in FE we should set the optimistic amount after converting it to the workspace currency What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Expense - Expense preview shows incorrect amount briefly when WS default currency is different What is the root cause of that problem?The main problem is how we get currency
What changes do you think we should make in order to solve the problem?Since in the workspace, we use an we can add
App/src/pages/iou/steps/NewRequestAmountPage.js Lines 187 to 194 in 9da929f
And then add
What alternative solutions did you explore? (Optional)As alternative, we can update the currency value from |
ProposalPlease re-state the problem we are trying to solve?Expense - Expense preview shows incorrect amount briefly when WS default currency is different What is the root cause?Two cases:
What changes should be made to fix this?Fix for Case 1 if (policy.outputCurrency === currency) {
iouReport.total -= amount;
} Note: Also, this is what we do for distance requests as well. We don't update Fix for Case 2 Additional improvement (Mentioned in this slack convo) We should also darken the report preview when we send a request offline to make sure the user knows that there is a pending request. Lines 145 to 150 in 2feaac8
pendingFields: {
request: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
} And this pending action can be cleared here: Lines 214 to 217 in 2feaac8
So, we just need to remove the condition ...(isNewIOUReport and just clear the pending and error fields everytime.
Now, we can use this <OfflineWithFeedback pendingAction={props.iouReport?.pendingFields?.request}> Now if we also want the header to be greyed out, we can possibly add a new pending action here: Line 3929 in 2feaac8
like this: const iouUpdatePendingAction = report?.pendingFields?.request; and then use this in the |
ProposalPlease re-state the problem that we are trying to solve in this issue.Expense preview shows incorrect amount briefly when WS default currency is different What is the root cause of that problem?
App/src/components/ReportActionItem/ReportPreview.js Lines 148 to 153 in 85f372c
The root cause of the problem comes from the frontend not having any way to convert different currencies, and there are no checks to determine and handle whether the currency of the money request's
This is the line where What changes do you think we should make in order to solve the problem?Since we do not have the correct amount from the server, every possible figure we can show will eventually change. Unless the currencies are the same, therefore, the most appropriate solution in this situation is to display Hence, we create a very strict condition that is only
App/src/components/ReportActionItem/ReportPreview.js Lines 150 to 152 in 85f372c
Using
Result Video: macOS.-.Chrome.movWhat alternative solutions did you explore? (Optional)This solution is like the previous one, but we use the amount in the very first money request currency,
We will use the same condition as before and change the line above to look something similar to the one below. This will return a formatted string with the amount using the very first money request's currency.
Result Video: macOS.-.Chrome.Alternative.mov |
We decided to do nothing here because we can't convert currency from the FE side |
@DylanDylann Could you share the link to that conversation? |
I think the current behaviour should be changed because if the user has already requested for example $12 and another request of ₹10 is made, it shows for a moment that the request is $22 which is obviously wrong and should not be done |
@c3024 Please check this discussion #26309 (comment) |
Thanks @DylanDylann The existing optimistic update behaviour for the report preview in the workspace chat is weird. But in the linked discussion you clearly laid out these cases and @danieldoglas and @dylanexpensify decided to do nothing here. So let's do nothing here. cc @NicMendonca |
@NicMendonca, @c3024 Eep! 4 days overdue now. Issues have feelings too... |
bump @c3024 on the updated proposal |
Triggered auto assignment to @nkuoch, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@esh-g Could you check this thread, too? Your proposal will fix it, right? |
@DylanDylann That is why it was decided to grey out the report preview to indicate a pending action. Moreover, we also do the same for offline distance requests. The preview doesn't get updated until you go online for distance requests as well. |
@nkuoch @NicMendonca @c3024 this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks! |
@nkuoch, @NicMendonca, @c3024 Eep! 4 days overdue now. Issues have feelings too... |
📣 @c3024 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @esh-g 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
PR is here: #33171 |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
This issue has not been updated in over 15 days. @nkuoch, @NicMendonca, @esh-g, @c3024 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! |
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:
|
Regression test proposalTest 1
Test 2
👍 or 👎 |
@NicMendonca Automation failed here and Melvin relegated this to Monthly. It'll take forever to come back into view. Can you please get this paid? |
both have been paid! |
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: 1.4.1.5
Reproducible in staging?: y
Reproducible in production?: y
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Action Performed:
Note that the amount in the confirmation shows the incorrect amount ($1234) briefly before the conversion.
Expected Result:
The amount in the expense preview will show the correct amount (MYR1234) briefly before the conversion.
Actual Result:
The amount in the expense preview shows the incorrect amount ($1234) briefly before the conversion.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6285572_1700575757806.20231121_203317.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: