-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
withinKilometers withinMiles withinRadians not working with Live Query #7480
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
Comments
Thanks for reporting! Could you add a failing test to demonstrate the issue? |
Hi, after new testing i found new elements : With Parse JavasScript SDK :
This not working However, if you not specify the last parameter of withinKilometers :
And this working However with Parse Flutter SDK :
Generate the cURL request which not working too :
So i see they are different result of request between Javascript SDK and Flutter SDK Test with Jasmine in /spec folder on parse-server repo :
Working test :
EDITED : On Parse Flutter SDK, if i override this method
By :
The override works : but you have to convert kilometers in maxDistance (see there) So i really think they are a problem with Live Query and Parse Javascript SDK / Parse Flutter SDK parameters EDITED 2 :
So $maxDistanceInKilometers $maxDistanceInMiles $maxDistanceInRadians must have to be converted to $maxDistance but it doesn't seems to work :/ EDITED 3 :
|
🤖 ParsyThanks for opening this issue!
I'm in beta, so forgive me if I'm still making mistakes. |
@PolSpock Never mind, that message was because this issue was written with an old template. I guess the bot should only comment on newly opened issues. |
I'm sure this has something to do with LiveQuery currently not supporting all query operators. More info here, specifically:
Though there has been additional support added in #7113 You can see that parse-server/src/LiveQuery/QueryTools.js Lines 305 to 311 in 1e0d408
While parse-server/src/LiveQuery/QueryTools.js Lines 336 to 340 in 1e0d408
When it comes to the Flutter SDK using You may want to open a PR to add support or edit your exiting PR. |
@mtrezza this should probably be labeled as an "enhancement" since it's known these operators aren't supported currently |
New Issue Checklist
Issue Description
I want to retrieve object only in a specific radius of the user current Position.
I use Live Query to get when object enter, update, leave theses conditions in real time.
However when i write a query with withinKilometers / withinMiles / withinRadians the Live Query never triggered when the Object has his GeoPoint enter / update / leave the specific radius.
Steps to reproduce
My javascript example :
Actual Outcome
My Live Query subscription is never triggered when the GeoPoint respect the subscription conditions.
If i replace the .subscription() by .find() the query worked fine, but this is not i want cause i need Live Query
Expected Outcome
I expect to get my
TestObject
when his location is update and still respect my subscription condition.In my example : a
TestObject
with "location"Parse.GeoPoint({latitude: 45, longitude: 2})
must be return to client because the client have the same position and the withinKilometers is respected.(see my example line
query.withinKilometers("location", new Parse.GeoPoint({latitude: 45, longitude: 2}), 1, false);
)Failing Test Case / Pull Request
Environment
Server
4.5.0
Windows 10.0.19043
local
Database
MongoDB
4.4.4
Local
Clients
3.3.0
3.1.0
Logs
No log
Regards !
The text was updated successfully, but these errors were encountered: