-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Describe the bug
Ratel UI GeoView bug
GeoVIew component's renderquery function tries to parse distance as json, if provided an invalid distance like 0, breaks and causes the page ui to turn white and unresponsive. It persists through site refreshes as ratel caches the last run query and tries to show its results again. The only solution after that is to clear the cache, resulting in the loss of all previous query history.
The reason is most likely that the circle around the center point with radius provided to near is re-rendered on the geoview tab without going through query validation.
To Reproduce
- Run ratel with any dgraph instance
- In query, write a near query with valid near value and run it.
{
user(func:near(location,[25,25],100)){
location{
coordinates
}
}
}
- Open the the geo tab
- Now modify the near distance value to 0 or empty
Expected behavior
Ratel ui should ideally give a warning about invalid circle radius or just show a default 0 radius point on the map on the center
Screenshots
after modifying distance to be an invalid value after a succesfully ran near query.

Environment
- OS: win10,
- Version :
latestfrom ratel ui at play.dgraph.io
Additional context
this happens because distance value in renderQuery function inside GeoView.js component is not validated before trying to parse it as JSON
It is fixed with a simple validation check on distance before JSON.parse and giving a default value (e.g 10 metres)
Results:
- Valid Distance
- Invalid Distance that is handled and logged



