onebusaway-application-modules
onebusaway-application-modules copied to clipboard
Vehicle status.lastLocationUpdateTime is seconds (instead of ms) past epoch
I got a report today from a user in Puget Sound that the "Last updated" time in the vehicle marker popup balloon is wrong in OBA Android:
Here's a sample trips-for-route
API request:
http://api.pugetsound.onebusaway.org/api/where/trips-for-route/1_102576.json?includeStatus=true&app_ver=62version=2&key=v1_BktoDJ2gJlu6nLM6LsT9H8IUbWc%3DcGF1bGN3YXR0c0BnbWFpbC5jb20%3D
...and a the status
block from that response:
status: {
activeTripId: "1_30904954",
blockTripSequence: 12,
closestStop: "1_30570",
closestStopTimeOffset: -7,
distanceAlongTrip: 11774.797356666386,
frequency: null,
lastKnownDistanceAlongTrip: 0,
lastKnownLocation: {
lat: 47.58036422729492,
lon: -122.32905578613281
},
lastKnownOrientation: 0,
lastLocationUpdateTime: 1465348788, // <-- Used to be milliseconds past epoch
lastUpdateTime: 1465348788000,
nextStop: "1_30590",
nextStopTimeOffset: 61,
orientation: 90,
phase: "in_progress",
position: {
lat: 47.58058676414876,
lon: -122.329063
},
predicted: true,
scheduleDeviation: 220,
scheduledDistanceAlongTrip: 11774.797356666386,
serviceDate: 1465282800000,
situationIds: [ ],
status: "default",
totalDistanceAlongTrip: 13179.505611838784,
vehicleId: "1_2710"
},
It looks like lastLocationUpdateTime
went from being milliseconds past epoch (i.e., System.currentTimeMillis()
) to seconds past epoch (i.e., POSIX time).
I'm guessing there was a server-side update recently that broke this? From some quick testing it looks like it's broken for all routes I've tested (randomly grabbed 5-6) in Puget Sound and Washington, D.C.
Also, just a guess - GTFS-realtime timestamps are POSIX time, it's possible the GTFS-rt timestamp is getting passed through to the OBA REST API unaltered?
@sheldonabrown Would you be able to roll out a fix for this quickly?
FYI, I'm the user who reported it. Feel free to ping me if you needed anything else.
Unfortunately I introduced this as part of: https://github.com/OneBusAway/onebusaway-application-modules/issues/151
This commit fixes it: https://github.com/camsys/onebusaway-application-modules/commit/e9dfd9dc599624dd0951beca0e6aefa0cefda5f1
The earliest I can roll this out is late next week -- it needs to go through change management. Is that sufficient?
Sheldon
On Tue, Jun 7, 2016 at 9:41 PM, Sean Barbeau [email protected] wrote:
I got a report today from a user in Puget Sound that the "Last updated" time in the vehicle marker popup balloon is wrong in OBA Android:
[image: image] https://cloud.githubusercontent.com/assets/928045/15880011/56bdfbca-2cf7-11e6-8597-4ba204c7f4bc.png
Here's a sample trips-for-route API request:
http://api.pugetsound.onebusaway.org/api/where/trips-for-route/1_102576.json?includeStatus=true&app_ver=62version=2&key=v1_BktoDJ2gJlu6nLM6LsT9H8IUbWc%3DcGF1bGN3YXR0c0BnbWFpbC5jb20%3D
...and a the status block from that response:
status: { activeTripId: "1_30904954", blockTripSequence: 12, closestStop: "1_30570", closestStopTimeOffset: -7, distanceAlongTrip: 11774.797356666386, frequency: null, lastKnownDistanceAlongTrip: 0, lastKnownLocation: { lat: 47.58036422729492, lon: -122.32905578613281 }, lastKnownOrientation: 0, lastLocationUpdateTime: 1465348788, // <-- Used to be milliseconds past epoch lastUpdateTime: 1465348788000, nextStop: "1_30590", nextStopTimeOffset: 61, orientation: 90, phase: "in_progress", position: { lat: 47.58058676414876, lon: -122.329063 }, predicted: true, scheduleDeviation: 220, scheduledDistanceAlongTrip: 11774.797356666386, serviceDate: 1465282800000, situationIds: [ ], status: "default", totalDistanceAlongTrip: 13179.505611838784, vehicleId: "1_2710" },
It looks like lastLocationUpdateTime went from being milliseconds past epoch (i.e., System.currentTimeMillis()) to seconds past epoch (i.e., POSIX time).
I'm guessing there was a server-side update recently that broke this? From some quick testing it looks like it's broken for all routes I've tested (randomly grabbed 5-6) in Puget Sound and Washington, D.C.
Also, just a guess - GTFS-realtime timestamps are POSIX time, it's possible the GTFS-rt timestamp is getting passed through to the OBA REST API unaltered?
@sheldonabrown https://github.com/sheldonabrown Would you be able to roll out a fix for this quickly?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OneBusAway/onebusaway-application-modules/issues/177, or mute the thread https://github.com/notifications/unsubscribe/AA9JHb-t_TnyF3vGc1y9Fu6qPfK9jphXks5qJh23gaJpZM4IwhNx .
Yes, that should work.
Thanks for the fix!
The fix rolled out this morning.
Thanks! From quick testing it looks like this is fixed in Puget Sound, but not WMATA in Washington, D.C. Is that expected?
Yes, sorry about that. Washington's fix will roll out Monday morning.
On Thu, Jun 16, 2016 at 9:48 AM, Sean Barbeau [email protected] wrote:
Thanks! From quick testing it looks like this is fixed in Puget Sound, but not WMATA in Washington, D.C. Is that expected?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OneBusAway/onebusaway-application-modules/issues/177#issuecomment-226490162, or mute the thread https://github.com/notifications/unsubscribe/AA9JHW4wudqVYoPvGsVx6J3BM1Dp2CA4ks5qMVRDgaJpZM4IwhNx .
Ok, thanks!
Washington rolled out.
:+1: Do you want to close this issue now, or wait until https://github.com/camsys/onebusaway-application-modules/commit/e9dfd9dc599624dd0951beca0e6aefa0cefda5f1 is merged?
Good point! I was hoping the merge to master would take care of this, but that's stalled now on some build issues and code cleanup. (read: I haven't had time to get back to it).
I leave it to you -- I'm ok with keeping it open to remind us not to loose the commit.
On Tue, Jun 21, 2016 at 6:11 PM, Sean Barbeau [email protected] wrote:
👍 Do you want to close this issue now, or wait until camsys/onebusaway-application-modules@e9dfd9d https://github.com/camsys/onebusaway-application-modules/commit/e9dfd9dc599624dd0951beca0e6aefa0cefda5f1 is merged?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OneBusAway/onebusaway-application-modules/issues/177#issuecomment-227588068, or mute the thread https://github.com/notifications/unsubscribe/AA9JHUfDhsHoV-EcDZdd9IL7mY0YMcPHks5qOGGVgaJpZM4IwhNx .
I guess let's leave this open until the commit makes it here.