-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 payment 2023-10-30] Profile - 'Country' doesn't change if selected manually and then another suggested address is selected #29382
Comments
Triggered auto assignment to @laurenreidexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalProblem'Country' not change if select it manually and then select another suggested address Root CauseIn ChangesWe can safely remove currentCountry from url so the useEffect run only on componentmount and url param change but not when currentCountry change. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Profile - 'Country' not change if select it manually and then select another suggested address What is the root cause of that problem?When we select country from country list, selected country is stored in route data. And we have this piece of code to retrieve this data from route and set local state App/src/pages/settings/Profile/PersonalDetails/AddressPage.js Lines 156 to 161 in 8e80bda
Notice that currentCountry is also in a dependency list. So when autocomplete changes country it will trigger above useEffect and it will read countryFromUrl and set it to current country reverting the changes.
What changes do you think we should make in order to solve the problem?We should remove What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Profile - 'Country' not change if select it manually and then select another suggested address What is the root cause of that problem?When the user selects a country from the country list, we will set the selected country to route. But when the country is completed automatically by Google API, we don't reset the country in the route. So that the country in route will override the selected country What changes do you think we should make in order to solve the problem?When a country is changed automatically by Google API (clicking suggestion from address line 1), we should reset the route to In here:
We should update like this
As mentioned here #29382 (comment) We also remove the redundant call by removing currentCountry here
ResultScreen.Recording.2023-10-16.at.22.04.06.mov |
Job added to Upwork: https://www.upwork.com/jobs/~0192336d38fb4edbd9 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @0xmiroslav ( |
@0xmiroslav what you think of the proposals above? |
@alitoshmatov's proposal looks good to me. |
Triggered auto assignment to @lakchote, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@0xmiroslav A bit curious, With @alitoshmatov's #29382 (comment) proposal, When we select new address line 1 the country will update but the country in the url still be old value. |
@DylanDylann I added explanation:
|
Sorry I miss it, If we remain the wrong url, user will be get wrong information when reloading |
Good point but we should optimize code as well. There's redundant call of
How will you reset this root manually though? |
hii @0xmiroslav my proposal was before the selected proposal and suggest enough to solve the problem, selected proposal has a minor change with no effect over the functionality
|
@ishpaul777 your solution was this one, am I wrong? |
omg this was a typo! sorry for confusion but my intent was to remove from dependency list, |
@0xmiroslav Updated proposal for more detail |
Still I am not inclined to force update route on the same page as we don't have this pattern yet in the app. (@DylanDylann tell me if you found any) |
I would prefer not having to update the route. It would be an edge case that on reload the user gets wrong information. |
@lakchote thanks for feedback. In this case, I think we can go with @ishpaul777 to be fair as it was just a typo |
📣 @0xmiroslav 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @ishpaul777 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@ishpaul777 do we have a draft PR up yet? Thanks! |
Sorry for not giving ETA. I am working on it will raise a PR by the end of today(wednesday). |
@0xmiroslav PR is up for your review, please take a look when you get the chance, Thanks! |
🎯 ⚡️ Woah @0xmiroslav / @ishpaul777, great job pushing this forwards! ⚡️ The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉
On to the next one 🚀 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.88-11 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-30. 🎊 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:
|
Payment Summary:
|
Wait @0xmiroslav can you confirm if it's Upwork or NewDot for payment for you? Thanks |
upwork yet |
|
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.3.81-6
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Action Performed:
Expected Result:
All fields are filled in correctly. Country replaced with the suggested one
Actual Result:
The “Country” field has not changed and remains the same as it was previously selected manually
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
Bug6233524_1697053961845.Desktop-Selected-County-not-change-to-suggested.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: