umts / pvta-multiplatform

Transit realtime app for mobile devices
Other
6 stars 5 forks source link

Departures disappear prematurely #488

Closed sherson closed 5 years ago

sherson commented 5 years ago

Bus tracker shows 10:30 bus but our app doesn't:

PVTrAck missing departure

Confirmed bus was still at stop, and missing departure was in stop departures endpoint:

<?xml version="1.0" encoding="UTF-8"?>
<Departure>
   <ADT i:nil="true"/>
   <ADTLocalTime i:nil="true"/>
   <ATA i:nil="true"/>
   <ATALocalTime i:nil="true"/>
   <Bay i:nil="true"/>
   <Dev>PT0S</Dev>
   <EDT>2019-03-27T10:30:00</EDT>
   <EDTLocalTime>2019-03-27T10:30:00</EDTLocalTime>
   <ETA>2019-03-27T10:25:44</ETA>
   <ETALocalTime>2019-03-27T10:25:44</ETALocalTime>
   <LastUpdated>2019-03-27T10:31:00.473</LastUpdated>
   <LastUpdatedLocalTime>2019-03-27T10:31:00.473</LastUpdatedLocalTime>
   <SDT>2019-03-27T10:30:00</SDT>
   <SDTLocalTime>2019-03-27T10:30:00</SDTLocalTime>
   <STA>2019-03-27T10:24:00</STA>
   <STALocalTime>2019-03-27T10:24:00</STALocalTime>
   <Trip>
      <BlockFareboxId>313</BlockFareboxId>
      <BlockRecordId>207</BlockRecordId>
      <IVRServiceDesc>South Amherst</IVRServiceDesc>
      <InternalSignDesc>31 South Amherst</InternalSignDesc>
      <InternetServiceDesc>South Amherst</InternetServiceDesc>
      <PatternRecordId>3475</PatternRecordId>
      <RunId>313</RunId>
      <RunRecordId>0</RunRecordId>
      <ServiceLevelRecordId>81</ServiceLevelRecordId>
      <StopSequence>0</StopSequence>
      <TripDirection>S</TripDirection>
      <TripId>1030</TripId>
      <TripRecordId>90859</TripRecordId>
      <TripStartTime>2006-01-01T10:30:00</TripStartTime>
      <TripStartTimeLocalTime>2006-01-01T10:30:00</TripStartTimeLocalTime>
   </Trip>
</Departure>

This sounds vaguely familiar... was there a reason we decided it should behave this way?

dfaulken commented 5 years ago

Was this at exactly 10:30?

https://github.com/umts/pvta-multiplatform/blob/630b9d741ca3d73e0edbe79a83111c6b059127f5/src/pages/stop/stop.component.ts#L252-L254

werebus commented 5 years ago

My guess from the screenshots is that it was at 10:30 plus some number of seconds more than 30 and less than 60 — I notice that out app says that 10:45 is "in 14 minutes"

This sounds like a precision problem; the EDT is only accurate to the minute. So, if the departure is at 10:30, and it is currently 10:30:40, then that bus may very well leave "at" 10:30, but that departure is also "in the past" compared to Date.now()

Anbranin commented 5 years ago

I'd compare it to now + 1 minute. I think humans don't tend to view the current minute as "in the past"