-
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
Bank Account - Some addresses give error without red outline and no information on what's wrong #5867
Comments
Triggered auto assignment to @tylerkaraszewski ( |
Oh I think this is related to this PR #5854 - @aldo-expensify |
The problem with that address and the result clicked is that the result is missing the JSON obtained from the result: [
{
"long_name": "64",
"short_name": "64",
"types": [
"street_number"
]
},
{
"long_name": "Noll Street",
"short_name": "Noll St",
"types": [
"route"
]
},
{
"long_name": "Bushwick",
"short_name": "Bushwick",
"types": [
"neighborhood",
"political"
]
},
{
"long_name": "Brooklyn",
"short_name": "Brooklyn",
"types": [
"sublocality_level_1",
"sublocality",
"political"
]
},
{
"long_name": "Kings County",
"short_name": "Kings County",
"types": [
"administrative_area_level_2",
"political"
]
},
{
"long_name": "New York",
"short_name": "NY",
"types": [
"administrative_area_level_1",
"political"
]
},
{
"long_name": "United States",
"short_name": "US",
"types": [
"country",
"political"
]
},
{
"long_name": "11206",
"short_name": "11206",
"types": [
"postal_code"
]
},
{
"long_name": "4604",
"short_name": "4604",
"types": [
"postal_code_suffix"
]
}
] |
Well, it seems like there will be cases where the "locality" (which is often a city) is missing: https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform Would be interesting to know which other cities in the US may have this problem. What can we do about it? in this case we could use the |
Removing deploy blocker per https://expensify.slack.com/archives/C020EPP9B9A/p1634274922234500 |
In the details of the selected result we have the location's coordinate. In the case of the address I did a test to reverse geocode coordinates to see if that would find me the city. Api url request based on the coordinates: https://maps.googleapis.com/maps/api/geocode/json?latlng=40.7007309,-73.9332924&key=XXX (you can open this URL in the browser, if you have an api key - I found a key in slack) This gives a bunch of results, but within the results, there was one that indeed had the city: response.results.find(result => result.address_components.find(component => component.types.includes('locality'))) This yields '{
"address_components": [
...
{
"long_name": "New York",
"short_name": "New York",
"types": [
"locality",
"political"
]
},
...
],
...
}' I don't know yet how reliable is this. If it was reliable, would we consider following such approach? I did a few tests using addresses from Brooklyn, Bronx and Queens, which have the missing city problem, and I always found the city using the reverse geocoding. The function I'm playing with looks like: const reverseGeocode = (latitude, longitude) => {
const apiKey = 'XXX';
const proxiedUrl = `/geocode/json?latlng=${latitude},${longitude}&key=${apiKey}`;
const url = `${CONFIG.EXPENSIFY.URL_EXPENSIFY_COM}api?command=Proxy_GooglePlaces&proxyUrl=${proxiedUrl}`;
//`https://maps.googleapis.com/maps/api/geocode/json?latlng=${latitude},${longitude}&key=${apiKey}`
fetch(url)
.then(response => response.json())
.then((response) => {
console.log(response);
const resultWithCity = response.results.find(result => result.address_components.find(component => component.types.includes('locality')));
console.log(resultWithCity);
});
}; |
@marcaaron @roryabraham what do you think about this? Would appreciate your opinion. |
Can you summarize the problem? I'm not sure I understand what the issue is. |
Currently this is affecting address in Brooklyn, Bronx and Queens, not sure if there are other neighbourhoods/cities with the problem. One option I'm thinking about, is to complement the information using the the geocode API when there is something missing:
Another option would be to just hardcode the problematic case of New York city, but we don't know if there could be other problematic cities. |
This sounds like something we may have to do anyway once we exhaust other alternatives. Tbh, I'm not sure what else could be done and the form is currently in a bad state. This is an edge case, but an important one (lots of people live in cities - if we can assume other cities like New York are affected). So, maybe we should be fixing this any way we possibly can and then discuss the good approach after 😄 Can we rule out that simply preferring to use the
I think we only need to worry about the US at the moment. Unsure if that helps narrow it down. I took a look at the docs you linked and I'm no less confused. I wish I could help more but don't have much experience with this API. |
I would be hesitant to start using the GPS coordinates to validate addresses – seems like that could lead to a near-infinite number of false positives if we're not careful, so if we can't find another solution I would prefer to hardcode the known exceptions of the boroughs of NYC. But before going down that road, let's try what @marcaaron suggested and fall back on the |
I was thinking that how prone to error it is depends on the type of information that we are trying to complete. A city probably would be correct by GPS coordinates, but a street could be more likely to be wrong. In any case, since NY seems to be the only problematic case at the moment, I agree with you both of using What do we use the address information for? there won't be any problem in using |
Nope, Brooklyn is the city. |
😮 🤯 |
I was assigned for triage but it looks like @aldo-expensify has this so I'm unassigning myself. |
From the accessibility prospective, it fails WCAG success criteria 3.3.1 and 3.3.3 since it is not clear what the error is and how to fix it. |
Not overdue, PR waiting for review.
We will continue having poor error feedback for this field once the PR is merge, we should address this later. Two cases that will cause an error with poor feedback:
|
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:
Expected Result:
There's a error message mentioning the user what is wrong with the provided address.
Actual Result:
There's no information on why the address is not valid. Some addresses are valid and I have no idea why some are not.
Workaround:
Enter a valid address (?) I guess this is not valid if the user is entering a correct address here.
Platform:
Where is this issue occurring?
Version Number: 1.1.7-22
Reproducible in staging?: Yes
Reproducible in production?: No
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
Issue reported by: Applause
Slack conversation:
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: