-
Couldn't load subscription status.
- Fork 1.1k
Closed
Description
If you have the following GTFS trip
| stop | arrival | departure |
|---|---|---|
| A | 10:00 | 10:01 |
| B | 10:01 | 10:01 |
| C | 10:01 | 10:02 |
which is a little odd but satisfies the GTFS spec and our internal constraints and apply a GTFS-RT trip update which SKIPs stop B, it fails with a NEGATIVE_HOP_TIME error.
That is because the stop cancellation logic assumes that the travel time between the stops is greater than zero:
Lines 92 to 95 in f1d0f7b
| int prevScheduledDeparture = builder.getScheduledDepartureTime(firstCanceledStop - 1); | |
| int scheduledTravelTime = builder.getScheduledArrivalTime(i) - prevScheduledDeparture; | |
| int realTimeTravelTime = arrival - prevDeparture; | |
| double travelTimeRatio = (double) realTimeTravelTime / scheduledTravelTime; |
If the travel time is zero, then travelTimeRatio becomes Infinity leading to validation errors.
cc @laurentg
laurentg
Metadata
Metadata
Assignees
Labels
No labels