Traewelling / traewelling

Free check-in service to log your public transit journeys
https://traewelling.de
GNU Affero General Public License v3.0
225 stars 45 forks source link

The start ID is not in the intermediate stops. #510

Closed MrKrisKrisu closed 2 years ago

MrKrisKrisu commented 2 years ago

User Report via Twitter

Ich würde ja gerne den RE 1 nach Trier bei @Traewelling hinzufügen aber die wollen das nicht 😂 ich habs auch mit einem anderen Zwischenhalt versucht, keine Chance 😅

Screenshots

Additional context See https://twitter.com/FloEllebrecht/status/1438616001289982040

MrKrisKrisu commented 2 years ago

I can confirm that with the RE1 on 16.09.2021 departure at 23:35 in SSH.

MrKrisKrisu commented 2 years ago

The TripID of this departure is 1|214067|0|80|16092021 with lineName RE 1.

If you want to select the trip in the station board, a trip with the same TripID is found in our database, which however has a different LineName. This is where the error that the station is not on the trip comes from. It is a different trip.

In my local environment with empty database it works.

This is the first case I know of where a TripID was assigned twice. I don't currently know how we can fix that.

URL to test: https://traewelling.de/trains/trip?tripID=1%7C214067%7C0%7C80%7C16092021&lineName=RE%201&start=8000323&departure=2021-09-16T23%3A35%3A00%2B02%3A00 photo_2021-09-17_14-10-12

MrKrisKrisu commented 2 years ago

One possibility would be to add lineName to the query here. However, to do this we would need to adjust our database layout beforehand. We have a unique key on tripId, so we can't store multiple trips with the same ID.

https://github.com/Traewelling/traewelling/blob/dd7a3f7605d354f29a9531a70ccc9df7a64ac14c/app/Http/Controllers/HafasController.php#L185

MrKrisKrisu commented 2 years ago

The error also occurs at stations in other time zones.

In London (HAFAS ID 7096001) it is not possible to check into a train. The error occurs in the function App\Http\Controllers\Controller\searchForId.

MrKrisKrisu commented 2 years ago

In the beta version you can check in there. But only because there is missing the function that checks against ring lines. The bug exists there for that.

MrKrisKrisu commented 2 years ago

Fixed in #789