Closed deingithub closed 7 months ago
Thanks for pointing this out!
detection of midnight crossings is needed to handle journeys that start before midnight but were requested after midnight, at least for DB HAFAS. I haven't yet looked into ÖBB or other APIs.
The UNIX timestamp is useless, unfortunately -- but the encoded date might work. I'll have to check that once I'm awake and online at a suitable time, so this will take a while.
Hi!
The cross-midnight detection and fix introduced in 4.14 assumes HAFAS jids look like this:
1|1485117|17|80|7102023
. When querying ÖBB HAFAS, however, the journey IDs look like this:The Date component is hidden at a different position in the jid, formatted as
71023
. But there's also a unix timestamp at1696575382
, so that might make parsing it less necessary? I don't really know enough about the issue worked around by cross-midnight detection to tell. As a consequence, in here, https://github.com/derf/Travel-Status-DE-DeutscheBahn/blob/585a063f27c0ffe25fc8b71f08d28dcec5478832/lib/Travel/Status/DE/HAFAS/Journey.pm#L92-L102$date_ref
winds up being undefined, so$datetime_ref
also winds up undefined, and on every time of day we get a torrent of warnings like these:If the journey, however, actually crosses midnight, this line https://github.com/derf/Travel-Status-DE-DeutscheBahn/blob/585a063f27c0ffe25fc8b71f08d28dcec5478832/lib/Travel/Status/DE/HAFAS/Journey.pm#L297 causes a crash, as
$datetime_ref
is undefined.