-
Notifications
You must be signed in to change notification settings - Fork 345
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
Internal State error, trying to remove location that is still in query #133
Comments
Another related question, is it possible to search via the northeast/southwest bounding coordinates instead of a radius? This would make more sense when using GeoFire with a map. Currently I'm grabbing the center of the map, then one of the corners and then using the distance between those two points as the radius of my search query -- with the only problem being needing to manually filter out results that are outside the borders of the map but still within the query circle. I think CouchDB has some geo stuff that uses a bounding box instead of a circle? |
Was anything done to this bug?? |
query radius to 6371km but still getting error. I temporarily hide this error throwing (and works!) but in the near future I will try to find solution (https://github.com/kasterlod/geofire-js) |
I have this error too, even if the radius is < 6000km. @kasterlod how did you catch this exception ? |
bump |
facing the same, any solution? |
I've had this problem as well at radius 6000. I put it down to radius 5000 and so far, I haven't seen the problem again. |
I think I finally solved this issue in my case, though this may or may not apply to other cases. For me, it was simply because I didn't call cancel on the geoquery (not just onKeyEntered type calls, but the entire query like geoquery.cancel()). My use case was using geoquery in a firebase cloud function, and GeoFire was still trying to do things after the function finished. |
Took me a while to reproduce this on the example, but here's a screenshot:
To reproduce, visit https://geofire.firebaseapp.com/queryBuilder/index.html and create a fish with latlng
34.0489281,-111.09373110000001
then create a query with radius 10000 and latlng43.92630646953202,127.05690366562499
then update the query with latlng43.16183777054158,-116.57590883437501
and then revert it back to latlng43.92630646953202,127.05690366562499
and update it few times and it throws the error:"Internal State error, trying to remove location that is still in query"
Now my wild guess as to why this happens is that the earth has a diameter of 12742km and so the biggest search radius should be half that. I tried drawing a circle on Google Maps and with the same radius as the query and depending where the center is and how far you're zoomed out you get a sine wave as opposed to a circle, and so I can only guess that when the search radius is too big you end up with an "overlap" or maybe a situation where a key is both in and out of the search circle at the same time. Again, this is only a guess.
I'd love a way to overcome this problem, and my current "solution" is based on my wild guess where I limit the size of the query radius to 6371km (half the diameter of the world to avoid circle overlap).
The text was updated successfully, but these errors were encountered: