Skip to content

Issue7480 max distance in kilometers params error #7526

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

Open
wants to merge 3 commits into
base: alpha
Choose a base branch
from

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