Skip to content

Conversation

PolSpock
Copy link

@PolSpock PolSpock commented Aug 27, 2021

New Pull Request Checklist

Issue Description

This PR just add 2 jasmine tests to show how the method withinKilometers() can be broken if you add the last parameter (order) with LiveQuery.
In fact, when you add the "order" parameter of withinKilometers(), the REST Request will be (and not working) :

verbose: Request: {"op":"subscribe","requestId":1,"query":{"className":"TestObject","where":{"location":{"$geoWithin":{"$centerSphere":[[-30,40],0.0003139224611520954]}}}}}

And if you don't give this parameter, the REST Request will be (and working) :

verbose: Request: {"op":"subscribe","requestId":1,"query":{"className":"TestObject","where":{"location":{"$nearSphere":{"__type":"GeoPoint","latitude":40,"longitude":-30},"$maxDistance":0.0003139224611520954}}}}

Related issue: 7480

Approach

With the Flutter Parse SDK, the whereWithinKilometers() method will generate the REST Request parameter $maxDistanceInKilometers but the MongoTransform.js doesn't correctly convert to a $maxDistance parameter.
So LiveQuery with whereWithinMiles(), whereWithinKilometers(), whereWithinRadians() of Flutter SDK not working with LiveQuery.

So i think the problem is on parse-server and not Parse-SDK-Flutter what's why i create my issue here.

TODOs before merging

  • Prevent flutter SDK developper of this issue

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.

1 participant