Commit Graph

28 Commits

Author SHA1 Message Date
715bef163c Add stopgap ETA of 1 second when the shuttle has arrived at a stop 2025-11-21 11:33:22 -08:00
645fe1055b Add createRedisClientForRepository method to deduplicate default Redis client in constructor 2025-11-20 16:41:14 -08:00
545eaef74a Add implementation and test for leaving stop event 2025-11-19 11:31:13 -08:00
f334054b5e Add SHUTTLE_WILL_LEAVE_STOP event and upload payload names 2025-11-18 19:17:04 -08:00
34b2ab05d4 Rename properties in WillArriveAtStopPayload for more clarity 2025-11-18 19:14:29 -08:00
a2f76703ea Remove behavior of ETA clearing when shuttle is approaching stop 2025-11-18 19:07:06 -08:00
8621f10721 Switch the order of fallbacks (previous 2h first)
Data from the current day is more representative of current traffic conditions than the same data from a previous day.
2025-11-14 10:49:23 -08:00
f8e7670b3f For data from last week and previous day, look back instead of looking forward 2025-11-14 10:40:37 -08:00
397eb2b588 Change one-hour windows to two hours
A set of shuttles may only make a complete set of trips in two hours, so this should capture more data when calculating ETAs.
2025-11-14 10:34:48 -08:00
2df8f389b3 Change the final fallback window to two hours 2025-11-13 20:23:14 -08:00
f9ed8f16ac Bind methods and log errors for missing keys 2025-11-13 20:08:15 -08:00
d6ad90ee7a Change SHUTTLE_WILL_ARRIVE_AT_STOP to return payload of last stop and current stop, to avoid data race 2025-11-13 18:52:13 -08:00
0cf2a4d2e7 Add logic to clear out previous ETAs 2025-11-13 18:35:20 -08:00
bf6a2e4667 Add recursive implementation of cascading ETA updates for multiple ordered stops 2025-11-13 17:38:53 -08:00
91584fc2ab Extract fallback logic to a separate method 2025-11-13 17:19:37 -08:00
7463cb27f1 Add proof-of-concept which also queries same time period yesterday, as well as last hour 2025-11-11 21:41:32 -08:00
1866224b5b Prevent shuttle arriving at same stop from firing the SHUTTLE_WILL_ARRIVE_AT_STOP event 2025-11-11 21:22:39 -08:00
ac81806b26 Swap implementations of two handler methods, and add reference implementation for adding travel time data 2025-11-11 19:51:31 -08:00
5e8a3c84a6 Add previous reference implementation of getAverageTravelTimeSeconds and method bindings 2025-11-11 19:41:19 -08:00
4b37f3a121 Add a helper method for setting the "reference time" of the self-updating repo 2025-11-11 19:34:05 -08:00
9af50ddfe9 Change the event name to SHUTTLE_WILL_ARRIVE_AT_STOP, and emit it before the stop is updated 2025-11-11 19:10:13 -08:00
bc7ba7d507 Subscribe to shuttle events and add stub methods 2025-11-11 18:56:46 -08:00
6cf61d1cdb Unify eventual getter implementations in a BaseRedisETARepository class 2025-11-11 18:47:13 -08:00
01c55d52ec Make BaseRedisRepository extend EventEmitter; make RedisShuttleRepository extend BaseRedisRepository 2025-11-11 12:31:32 -08:00
13bfc853e3 Add getAverageTravelTimeSeconds in SelfUpdatingETARepository definition 2025-11-11 12:26:45 -08:00
cb23379723 Add shuttleRepository injection to the constructor of RedisSelfUpdatingETARepository 2025-11-11 11:41:39 -08:00
e707c9cfd8 Have the ETA repositories depend on BaseRedisRepository instead of duplicating methods 2025-11-11 11:33:45 -08:00
53e120cd1e Add stubs for Redis implementations of both ETA repository variants 2025-11-11 10:54:46 -08:00