Algolia 'geoDistance' result changed from -1 to large number when upgrading Flutter?

flutter
dart
#1

Hey team,

we have been using Algolia for a while in our Flutter app, working directly with the Rest API since there is no client currently available for Dart (works great btw).

Until recently we have been getting -1 returned on geoDistance for records without a _geoLoc property.

Here is an example of a record with a _geoLoc first (an actual correct geoDistance), followed by a record without a _geoLoc property (-1 returned):

[+188169 ms] I/flutter ( 3914): {nbTypos: 0, firstMatchedWord: 0, proximityDistance: 0, userScore: 2594, geoDistance: 8239768, geoPrecision: 1, nbExactWords: 0, words: 0, filters: 1, matchedGeoLocation: {lat:
60.472, lng: 8.4689, distance: 8239768}}
[        ] I/flutter ( 3914): geodistance=
[        ] I/flutter ( 3914): 8239768
[        ] I/flutter ( 3914): {nbTypos: 0, firstMatchedWord: 0, proximityDistance: 0, userScore: 17430, geoDistance: -1, geoPrecision: 1, nbExactWords: 0, words: 0, filters: 1}
[        ] I/flutter ( 3914): geodistance=
[        ] I/flutter ( 3914): -1

In the new alpha of our app we noticed it started crashing when casting geoDistance to an int, and upon investigating we see that the number returned is now pretty large, here’s an example:

"_rankingInfo":{"nbTypos":0,"firstMatchedWord":0,"proximityDistance":0,"userScore":17430,"geoDistance":18446744073709551615,"geoPrecision":1,"nbExactWords":0,"words":0,"filters":1}},

(geoDistance 18446744073709551615)

The above is just what is returned from the server saved to a text to disk (before we do any parsing or anything with it).

Reverting Flutter back to 1.2.1 we get -1 again and then running the latest version we get the large number. So it seems related to something that Flutter sends, a header or something, that makes Algolia change the geoDistance response?

It also looks related to this post from 2017 btw: GeoDistance huge number

Anyway, would be nice to figure out what’s going on here :slight_smile:

#2

Hello!
Thank you for a detailed description of your issue.
Could you send your appID to support@algolia.com with the same subject name so we can figure out the cause?

1 Like