Bug 374445 - Calls to CycleStreets API are sometimes incomplete
Summary: Calls to CycleStreets API are sometimes incomplete
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: data (show other bugs)
Version: unspecified
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-02 02:02 UTC by CycleStreets
Modified: 2017-01-02 18:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CycleStreets 2017-01-02 02:02:02 UTC
Hi,

I'm writing from CycleStreets, whose API you have kindly integrated for bicycle routing:
http://commits.kde.org/marble/af22018eb38e7ff48b10ab0a131809a342db8a1c

We get plenty of requests from Marble users, which is great, but amongst a small percentage of these, we noticed that some fail due to incomplete parameters.

For instance, we sometimes receive an API request like this:

/api/journey.xml?itinerarypoints=11.431882,44.465502%7C11.437141,44.519076&key=cdccf13997d59e70&plan&speed&useDom=1

(prefix this with http://www.cyclestreets.net )

As you can see, the plan and speed parameters are missing. The correct version of this request would be:

/api/journey.xml?itinerarypoints=11.431882,44.465502%7C11.437141,44.519076&key=cdccf13997d59e70&plan=balanced&speed=20&useDom=1

Sensible defaults would be plan=balanced and speed=20, which are what the API will default to if no parameter is specified. But above the request specifies each parameter but with an empty value, hence the failure.

I myself can't see in the code what is causing the missing parameters:
https://github.com/KDE/marble/search?q=cyclestreets

(P.S. I will file a separate issue report on a couple of potential improvements you could make for the API calls.)
Comment 1 Dennis Nienhüser 2017-01-02 18:38:12 UTC
Git commit 1fb2ad4977ec58385bf086dd0aa9bb3d8ce4873b by Dennis Nienhüser.
Committed on 02/01/2017 at 18:21.
Pushed by nienhueser into branch 'master'.

If 'plan' or 'speed' options are not set, use default values

The values could be empty if the config file is corrupted.

M  +8    -0    src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp

https://commits.kde.org/marble/1fb2ad4977ec58385bf086dd0aa9bb3d8ce4873b
Comment 2 Dennis Nienhüser 2017-01-02 18:44:53 UTC
Git commit 9301b9692690db4b46b271c9adcd926af5d025d1 by Dennis Nienhüser.
Committed on 02/01/2017 at 18:45.
Pushed by nienhueser into branch 'Applications/16.12'.

If 'plan' or 'speed' options are not set, use default values

The values could be empty if the config file is corrupted.
(cherry picked from commit 1fb2ad4977ec58385bf086dd0aa9bb3d8ce4873b)

M  +8    -0    src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp

https://commits.kde.org/marble/9301b9692690db4b46b271c9adcd926af5d025d1
Comment 3 Dennis Nienhüser 2017-01-02 18:48:12 UTC
Not really sure why this would happen as well, broken config files could be a reason. The fix above should catch it in any case. Pushed it to git master and the stable branch. It might take quite some time though to reach all users since it depends on them (their company, Linux distribution, ...) to update the software.