OpendataCH / Transport

Swiss public transport API
http://transport.opendata.ch/
MIT License
241 stars 50 forks source link

Request with isArrivalTime=1 yields connections after the indicated time #198

Closed mbeer closed 5 years ago

mbeer commented 5 years ago

The behaviour of requests for connections seems to have changed without notice:

The request https://transport.opendata.ch/v1/connections?from=Luzern&to=Aarau&date=2019-05-22&time=12:00&isArrivalTime=1 gives four connections with arrival times

respectively. These connections all arrive at the destination after the requested time. The expected (and former) behaviour was to get connections that arrive before the requested time, when isArrivalTime is set to 1.

fabian commented 5 years ago

Thanks for the report! There was a recent change at timetable.search.ch which probably caused this, see also https://github.com/OpendataCH/Transport/pull/197.

I think the default logic slightly changed on timetable.search.ch - we now have to use pre for page zero and negative.

I've played around with it and I think this should fix it: https://github.com/OpendataCH/Transport/pull/199

If you could check and verify the change it would be appreciated!

mbeer commented 5 years ago

Great. This looks fine to me. Thanks.

fabian commented 5 years ago

@mbeer Okay, deployed and should be fixed now.