onebusaway-application-modules icon indicating copy to clipboard operation
onebusaway-application-modules copied to clipboard

Method isTripActive able to check the delay cases in StopTimeUpdate

Open TsimurSh opened this issue 7 months ago • 3 comments

Hi, Please take a look at this change. Unfortunately, this method will regret all trips and mark them as inactive if the tripUpdates use a delay in the stopTimeUpdate.

TsimurSh avatar Jun 05 '25 14:06 TsimurSh

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 05 '25 14:06 CLAassistant

Thanks for your contribution. Can you elaborate on the scenario you’re solving for and also add tests that validate it?

aaronbrethorst avatar Jun 05 '25 14:06 aaronbrethorst

Ok. I added a test. Problems what it solve: In normal GTFS-realtime updates, trip predictions are considered active if:

  • There’s at least one stop time update,
  • And its first and last stop predictions fall within a valid time window. But sometimes a TripUpdate:
  • Lacks timestamps (i.e., no arrival.time),
  • Only has a delay

The previous logic would fail in such a case because it relies on arrival/departure time values.

@aaronbrethorst Take a look at.

TsimurSh avatar Jun 20 '25 11:06 TsimurSh