summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-10-06 16:32:58 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-10-06 16:32:58 +0200
commitaaaeec5c305ff1f8fc8813b025a3328f597cd433 (patch)
tree0543c861daa5af34af24e8b0abde15f356e92744
parenta2d08bca26086c402c2249bf755f84abda8c83f6 (diff)
Travelynx.pm: Document the real cause of sched_arr-isa-DateTime bug
-rwxr-xr-xlib/Travelynx.pm19
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 931745e..0c23a3a 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -1874,12 +1874,6 @@ sub startup {
)->then(
sub {
my ($traininfo) = @_;
-
- # FIXME when a station appears several times in a route
- # (e.g. Frankfurt Flughafen on some nightly connections), this
- # method chain sets the same timing reference on each stop,
- # causing murder and mayhem later on (e.g. in get_user_status)
-
if ( not $traininfo or $traininfo->{error} ) {
$self->app->log->debug("traininfo error");
return Mojo::Promise->reject("traininfo error");
@@ -2518,14 +2512,13 @@ sub startup {
for my $station (@route_after) {
if ( @{$station} > 1 ) {
- my $times = $station->[1];
- # TODO this is a workaround.
- # A station may be present several times in @route_after
- # (e.g. Frankfurt Flughafen at some nightly connections).
- # At the moment, there's a bug causing the time ref of
- # each stop to be the same -> ensure that it is not converted
- # to DateTime twice.
+ # Note: $station->[1]{sched_arr} may already have been
+ # converted to a DateTime object in $station->[1] is
+ # $dep_info. This can happen when a station is present
+ # several times in a train's route, e.g. for Frankfurt
+ # Flughafen in some nightly connections.
+ my $times = $station->[1];
if ( $times->{sched_arr}
and ref( $times->{sched_arr} ) ne 'DateTime' )
{