Skip to content

Conversation

@nickoneill
Copy link
Member

Sometimes folks calling from overseas would say they could not set an address manually. This makes sense as we were constantly trying to navigate from the NoLocation state to the GettingAutomatically state even if it had previously failed. Instead, set the state to EnterManually if the server response from the reps endpoint returns an error.

@nickoneill nickoneill requested a review from aholachek April 22, 2025 05:19
@aholachek aholachek requested a review from Copilot April 23, 2025 01:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the user experience when geolocation retrieval fails by updating the component's state to allow manual address entry. Key changes include:

  • Introducing a new state flag (hasGeolocationFailed) to track geolocation failures.
  • Short-circuiting the automatic location retrieval function when a failure is detected.
  • Adjusting error handling in the geolocation promise chains by updating the component state accordingly.

Copy link
Collaborator

@aholachek aholachek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tagging me -- code looks good, though I dumbly can't figure out how to test this flow -- do you have to be in a non-us location and trigger "get location automatically"?

@nickoneill
Copy link
Member Author

If we can request browser location, we try to do that first when a user taps "Set your location" regardless of location. If you have turned off location permission for the site you'll just see the manual flow so check if you have that denied somewhere.

This specific issue was triggering when a reps call was returning an error, very common if your browser location is outside the US. But we should always let people get back to manual location input if they want.

@nickoneill nickoneill merged commit 505e505 into main Apr 28, 2025
6 checks passed
@nickoneill nickoneill deleted the nickoneill/location-fails branch April 28, 2025 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants