OneBusAway / onebusaway-alexa

An Java-based app to communicate with Amazon Alexa for devices such as the Amazon Echo
Other
52 stars 18 forks source link

Use OBA server "now" time to calculate ETA #11

Closed barbeau closed 8 years ago

barbeau commented 8 years ago

Currently the ETA for a bus arrival is calculated as the estimated arrival time from the OBA server response minus "now" on AWS. This introduces the potential for clock sync issues.

We can change this to use the "now" calculated on the OBA server - from https://github.com/OneBusAway/onebusaway-alexa/pull/8#discussion_r53048665:

.getCurrentTime() is a method of ObaArrivalInfoResponse, which isn't directly exposed with the current setup - we'd need to structure the ObaUserClient class to return the ObaArrivalInfoResponse instead of the ObaArrivalInfo[], so we can pass in ObaArrivalInfoResponse.getCurrentTime() to the ArrivalInfo constructor.