Skip to content
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

[$250] Address - Country field reverts to the previous selection after selecting a new state #44957

Closed
6 tasks done
lanitochka17 opened this issue Jul 8, 2024 · 33 comments
Closed
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Jul 8, 2024

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: 9.0.5-3
Reproducible in staging?: Y
Reproducible in production?: N
**If this was caught during regression testing, add the test name, ID and link from TestRail:**N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Account settings > Profile
  3. Click Address
  4. Click Country
  5. Select a country
  6. Enter a US address and select any US address
  7. Click State
  8. Select a different state

Expected Result:

The country field will not revert to the previous selection after selecting a new state

Actual Result:

The country field reverts to the previous selection after selecting a new state

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6535805_1720442346387.country.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0114854c60bfc7069c
  • Upwork Job ID: 1810317607567373547
  • Last Price Increase: 2024-07-08
  • Automatic offers:
    • hoangzinh | Contributor | 103031606
    • nkdengineer | Contributor | 103032506
Issue OwnerCurrent Issue Owner: @puneetlath
@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API labels Jul 8, 2024
Copy link

melvin-bot bot commented Jul 8, 2024

Triggered auto assignment to @lakchote (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link
Contributor

github-actions bot commented Jul 8, 2024

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@lanitochka17
Copy link
Author

@lakchote FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp

@Julesssss
Copy link
Contributor

I see no obvious cause in our checklist so far...

@lakchote
Copy link
Contributor

lakchote commented Jul 8, 2024

I found the culprit, it's #43348

cc @mountiny

Copy link

melvin-bot bot commented Jul 8, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0114854c60bfc7069c

@melvin-bot melvin-bot bot changed the title Address - Country field reverts to the previous selection after selecting a new state [$250] Address - Country field reverts to the previous selection after selecting a new state Jul 8, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 8, 2024
Copy link

melvin-bot bot commented Jul 8, 2024

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

@lakchote lakchote assigned mountiny and hoangzinh and unassigned hoangzinh Jul 8, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 8, 2024
Copy link

melvin-bot bot commented Jul 8, 2024

📣 @hoangzinh 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@lakchote lakchote added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 8, 2024
@lakchote
Copy link
Contributor

lakchote commented Jul 8, 2024

I've talked with @mountiny on the matter, refactoring was difficult to undertake, as such we should try to find the issue and fix.

Which is why I've made it External.

@nkdengineer
Copy link
Contributor

nkdengineer commented Jul 8, 2024

@lakchote @mountiny I'm happy to raise PR asap if assigned

Proposal

Please re-state the problem that we are trying to solve in this issue.

The country field reverts to the previous selection after selecting a new state

What is the root cause of that problem?

In

const activeRoute = Navigation.getActiveRoute();
, we use getActiveRoute, not getActiveRouteWithoutParams like in CountrySelector
const activeRoute = Navigation.getActiveRouteWithoutParams();

So the param of the old country left over in the route param is still used, and the country gets updated to the old value. If we look at the param in the URL path when selecting state, we'll see that &country=AQ (old country code) is there, means the route we're using is wrong (it contains outdated param)

What changes do you think we should make in order to solve the problem?

In StateSelector here

const activeRoute = Navigation.getActiveRoute();
, use getActiveRouteWithoutParams like in CountrySelector

const activeRoute = Navigation.getActiveRouteWithoutParams();

What alternative solutions did you explore? (Optional)

@Julesssss Julesssss self-assigned this Jul 8, 2024
@mountiny
Copy link
Contributor

mountiny commented Jul 9, 2024

@nkdengineer We had to revert your change here #45121 as as it led to worse blocker.

Lets find a proper solution for this issue and make sure #45060 is not brought back. cc @mateuuszzzzz can help maybe

@nkdengineer
Copy link
Contributor

nkdengineer commented Jul 10, 2024

I'll raise follow PR soon

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 10, 2024
@mountiny mountiny added Daily KSv2 and removed Reviewing Has a PR in review Weekly KSv2 labels Jul 10, 2024
@mountiny
Copy link
Contributor

@nkdengineer lets try to identify the root cause as @s77rt highlighted it seems like we are still not clear on that

@mountiny mountiny added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 10, 2024
@zfurtak
Copy link
Contributor

zfurtak commented Jul 15, 2024

hi there 😊 after investigation, me and @mateuuszzzzz came to a conclusion that the problem here is connected to navigation. 🤔
Function getActiveRoute() was returning wrong path (with previously selected country) and the result was being passed to backTo param.
I made a PR with a fix for that problem. 👩🏽‍💻

@melvin-bot melvin-bot bot added Overdue Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 Overdue labels Jul 15, 2024
@mountiny
Copy link
Contributor

Thank you! PR merged

@hoangzinh
Copy link
Contributor

PR #45394 (comment) has been deployed to Prod since last week. It's payment time :yay:

@hoangzinh
Copy link
Contributor

@lakchote already found the offending PR #44957 (comment). Therefore we don't need a BZ checklist 🤔

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@puneetlath
Copy link
Contributor

@mountiny can you help me understand what needs to happen here. I see that both @s77rt and @hoangzinh reviewed this PR. Do they both need to be paid?

@s77rt
Copy link
Contributor

s77rt commented Aug 5, 2024

@puneetlath Only @hoangzinh is due payment

@puneetlath
Copy link
Contributor

Got it! @hoangzinh has been paid.

@mountiny is @nkdengineer due any payment here?

@hoangzinh
Copy link
Contributor

I think nope. @nkdengineer's PR has been reverted here #44957 (comment).

@puneetlath
Copy link
Contributor

Ok going to go ahead and close this out then. Thanks everyone!

@mountiny
Copy link
Contributor

mountiny commented Aug 8, 2024

Thanks for handling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

10 participants