Closed laugengebaeck closed 3 years ago
The 603 Bus seams to be a ring structure, at least thats what the API gives me:
I have modified the Check-In method, it will now match the stations with their arrival/departure times.
I will add some test cases (using the 603 bus) and then upload a PR.
Describe the bug https://traewelling.de/status/129666 (which also seems to suffer from the bug described in https://github.com/Traewelling/traewelling/issues/10) and https://traewelling.de/status/129656 are trips with a negative journey time. The bus/train also seems to arrive at the destination before it leaves at the start.
To Reproduce Steps to reproduce the behavior:
Höhenstr., Potsdam
Platz der Einheit/West, Potsdam
Rathaus, Potsdam
(any other stop might also work)Alternatively:
Berlin Westkreuz
Berlin Südkreuz (S)
Berlin-Tempelhof
(any other stop after that might also work)Expected behavior The logged journey time should not be negative and the bus/train should not arrive before it has started. Also, the arrival time should be correct (the departure time is already correct).
Additional context The bug seems to happen when two busses (one-way and back) or two trains (two times around the circle) are squeezed into a single hafas trip. When this happens, stations can appear multiple times in one trip. It seems like Traewelling then internally chooses the first time a station appears in the trip as the destination, rather than that one the user really chose.