Closed adesurirey closed 5 years ago
Hi @adesurirey, I've never come across this issue before. I think it would help to understand how your users are using the geocoder. Why is the query so long? Are the users copying and pasting it? Queries that long don't work with Mapbox's geocoder. I just tried it here https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-geocoder/. If it's that long because they are editing a result they previously picked (they could hit the clear icon instead of doing this), you could use a combination of the inputValue
and onResult
props to truncate the value in the input field. Here's an example: https://codesandbox.io/s/react-map-gl-geocoder-shorten-query-result-example-k0jmq.
The normal workflow is typing a few characters and selecting one of the options. Typically the queries usually don't have more than a few tokens. I think most of my own queries are only one or two tokens.
My gut feeling is that your users probably don't even notice this error. I personally would ignore these Sentry errors unless you verify that it is a problem.
Hi @SamSamskies, can't know exactly but I think you're right about copy and pasting long address. I'll go with your solution. Thanks !
Some of my users are experiencing 422 errors in production.
Here is an example of log received through Sentry.io :
As seen in Mapbox documentation, we may have to filter words in query so it never sends more than 20 words: https://docs.mapbox.com/api/search/#geocoding-api-errors
Let me know if you have the same issue and if I can do anything.
Thanks