-
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
[HOLD for C+ newdot payment] [$500] Web - App crashes when currency in url is changed to invalid currency code #26619
Comments
Triggered auto assignment to @kadiealexander ( |
Bug0 Triage Checklist (Main S/O)
|
Proposal by: @alitoshmatov ProposalPlease re-state the problem that we are trying to solve in this issue.App crashes when currency in url is changed to invalid currency code What is the root cause of that problem?The issue is happening because we are not checking if currency from route params is valid or not.
What changes do you think we should make in order to solve the problem?We should introduce a process to check if currency from route param is valid or not, then accept it only if it is a valid currency if not we should fallback to default currency. function validateCurrency(route) {
const currencyCode = lodashGet(route, 'params.currency', '');
const currency = lodashGet(currencyList, currencyCode);
return currency ? currencyCode : '';
} By returning empty string, we let it fallback to default currency which
What alternative solutions did you explore? (Optional) |
Job added to Upwork: https://www.upwork.com/jobs/~0140a8a0afc8dbbe3d |
Current assignee @kadiealexander is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The app crashes when the currency in the URL is changed to an invalid currency code. What is the root cause of that problem?We currently don't perform a check to verify whether the currency from the route parameters is valid or not. Additionally, when the currency code length exceeds 3 characters, the app crashes due to the Here are the relevant code sections: Lines 51 to 57 in ebcc8d0
Lines 75 to 83 in ebcc8d0
What changes do you think we should make in order to solve the problem?We can find the relevant code here:
Lines 65 to 67 in 44721d2
Fortunately, we already have a function for obtaining the currency symbol. If the currency symbol is undefined , it signifies that the currency is invalid. While we could create a custom validation function for currency, I believe it would be more consistent and simpler to add the validation logic for currency to the submit button in the MoneyRequestAmountForm .
We can also use a default value when
Considering the second issue, we have two options for addressing it within the functions in the First, we can employ the For example:
I would prefer the second option because it's simpler and more straightforward. What alternative solutions did you explore? (Optional)Alternatively, we can include form helper text in our money request form to display the error using the proposed validation logic. Result: |
@sobitneupane, @kadiealexander Still overdue 6 days?! Let's take care of this! |
@sobitneupane, @kadiealexander 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
Thanks for the proposal @alitoshmatov and @napster125 . I believe it's better idea to show default currency instead of disabling the button. So, proposal from @alitoshmatov looks good to me. @alitoshmatov Let's make sure to handle the case in edit and confirmation money request page as well if it exists. 🎀 👀 🎀 C+ reviewed |
👍 Proposal looks good, though I think validateCurrency should only return boolean if currency is valid. We can address that in a PR. |
@alitoshmatov needs to comment on this issue, so I can assign them. |
📣 @sobitneupane Please request via NewDot manual requests for the Reviewer role ($500) |
❌ There was an error making the offer to @alitoshmatov for the Contributor role. The BZ member will need to manually hire the contributor. cc @thienlnam |
❌ There was an error making the offer to @alitoshmatov for the Reporter role. The BZ member will need to manually hire the contributor. cc @thienlnam |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.73-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-10-02. 🎊 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:
|
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:
|
Awaiting payment and need to complete checklist here |
Applied to the upwork job since automation didn't work |
Payouts due:
Eligible for 50% #urgency bonus? No Upwork job is here. |
@alitoshmatov could you please apply here? https://www.upwork.com/jobs/~0196e99f5c78661337 |
@kadiealexander Applied |
@alitoshmatov sent you a contract! |
@kadiealexander Accepted contract |
This is an edge case and could have easily missed in PR review.
Yes.
|
Regression Test Proposal
Do we agree 👍 or 👎 |
Looks good 👍 |
Requested payment on newDot |
$500 payment approved for @sobitneupane based on BZ summary. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Action Performed:
ABCD
Another case:
ABC
Expected Result:
In both cases invalid currency should be ignored and default currency should be selected
Actual Result:
a) App crashes.
b) You can request money with invalid currency code
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.62.0
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
Notes/Photos/Videos: Any additional supporting documentation
Case A
Screen.Recording.2023-08-30.at.14.12.14.mov
Recording.4221.mp4
Case B
Screen.Recording.2023-08-30.at.14.13.11.mov
Recording.4223.mp4
Expensify/Expensify Issue URL:
Issue reported by: @alitoshmatov
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693385994296529
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: