cyclestreets / mobileweb2011

Mobile HTML client - LEGACY site
https://oldm.cyclestreets.net/
13 stars 2 forks source link

API call can send =undefined #30

Closed mvl22 closed 13 years ago

mvl22 commented 13 years ago

Just had an API request failure appear in our logs, caused by:

http://www.cyclestreets.net/api/journey.json?callback=journey&key=...&start_latitude=undefined&start_longitude=undefined&finish_latitude=51.777985&finish_longitude=-1.262946&plan=balanced&speed=20&_=1315953002289

(also, I wonder what the _= is?)

annapowellsmith commented 13 years ago

The _ is the function name wrapper for returning JSONP. Looking at this now...

annapowellsmith commented 13 years ago

I've added better checks: https://github.com/cyclestreets/mobileweb/commit/b09d26e18f97808338d219726e8c75d5cffd4d85

...and error handling: https://github.com/cyclestreets/mobileweb/commits/

The bigger question is how the user was able to set a finish point without a start point: I hope this isn't some nasty race condition. Still, if it happens again, it should at least fail gracefully.

mvl22 commented 13 years ago

I wonder if this is a case of the route-by-name but with the geolocation not being picked up.

I'll let you know if we see any more of these in the error logs, and see if we can get a reproduce case. Hopefully the catches above should prevent the symptom.