umts / pvta-multiplatform

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

Display Time only as Positive Values #453

Open mboneil10 opened 6 years ago

mboneil10 commented 6 years ago

In development mode, I ran into the following issue:

screen shot 2018-03-12 at 12 50 11 pm

Should probably say "early" or "on time" next to the clock symbol. Not sure if this is also happening in production.

dfaulken commented 6 years ago

They're two separate data points, right? The status of the bus and its EDT? Arguably we're just accurately reporting inconsistent data.

werebus commented 6 years ago

I'm not 100% sure, but I believe @akaplo found that the only two values ever reported were "Late" and "On Time". Indeed that is the case e.g. right now:

$ curl -s --header 'Accept: application/json' 'https://bustracker.pvta.com/InfoPoint/rest/Vehicles/GetAllVehicles' | jq '.[] | .DisplayStatus' | sort -u
"Late"
"On Time"

$ curl -s --header 'Accept: application/json' 'https://bustracker.pvta.com/InfoPoint/rest/Vehicles/GetAllVehicles' | jq '.[] | .Deviation' | sort -n
-5
-5
-4
-2
0
#...
0
1
#...
6
7
9
9
10
12
20
werebus commented 6 years ago

Ugh. At first I thought, "Oh, look! there's a field OpStatus that sometimes contains the string "EARLY", perhaps that's a good source of information." Nope. Take a look at this grab-bag of :cow:

akaplo commented 6 years ago

Right, a vehicle's DisplayStatus is either On Time or Late. Unfortunately, best approach for our users is probably to check for a negative Deviation, flip DisplayStatus to whichever it isn't equal to, and strip out the negative. Ugh!

mboneil10 commented 6 years ago

I think with this one @werebus, @sherson and I decided that it would be best to ask Avail if we can display "Early" or strip out the negative without any bad side effects.