Commit Graph

24 Commits

Author SHA1 Message Date
6d66e8f25b Add system ID prefix to all Redis keys to prevent cross-system ID clashes
When multiple university systems share the same Redis instance, entity IDs
(shuttles, stops, routes, etc.) could collide. This namespaces all Redis
keys with the system ID (e.g., `1:shuttle:stop:123` instead of
`shuttle:stop:123`).

- Add systemId field and prefixKey() helper to BaseRedisRepository
- Update all Redis repository subclasses to use prefixed keys
- Wire system ID from InterchangeSystem.build() into Redis repositories
- Add migration utility (migrateRedisKeysToSystemPrefix) with tests
- Update all test holders to pass a test system ID

https://claude.ai/code/session_012Vfz1NHWJbVtoDEWcE5tq6
2026-03-23 23:17:13 +00:00
ee10daf957 Rename getArrivedStopIfExists to getArrivedStopIfNextStop, and add more documentation 2025-11-21 11:42:42 -08:00
6c199e38a8 Test previously failing case for SHUTTLE_WILL_LEAVE_STOP 2025-11-21 11:10:10 -08:00
413443a162 Update the method to accept a canReturnShuttleCurrentStop flag instead 2025-11-21 11:07:47 -08:00
712e311006 Update getArrivedStopIfExists method to take an argument returnNextStopOnly 2025-11-21 10:51:38 -08:00
ddab9b96ff Remove SHUTTLE_IS_NEAR_NEXT_STOP event and placeholder tests 2025-11-20 17:47:13 -08:00
fb01406a29 Add placeholder test cases for SHUTTLE_IS_NEAR_NEXT_STOP event 2025-11-19 11:51:58 -08:00
4ffdd35b21 Add other tests (one for multiple events, one for not emitting the event) 2025-11-18 20:02:06 -08:00
8d9ff3ac62 Add a test for emitting the event 2025-11-18 19:57:15 -08:00
47708d050e Move duplicate shuttle declarations in tests to a "sample" shuttle generated by the setup function 2025-11-18 19:50:07 -08:00
34b2ab05d4 Rename properties in WillArriveAtStopPayload for more clarity 2025-11-18 19:14:29 -08:00
1511b3c118 Add test case to check that last stop data is removed 2025-11-14 10:23:02 -08:00
4523badea9 Test that clearShuttleData also clears last stop data 2025-11-14 10:17:33 -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
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
a3bfa4894e Fix date type mismatch for data comparison 2025-11-11 18:35:13 -08:00
5b1c5897fc Re-apply event emitter tests for the new shuttle events 2025-11-11 16:53:27 -08:00
90041555a9 Remove ETA-related tests from ShuttleRepositorySharedTests 2025-11-11 15:30:43 -08:00
99999450b5 Remove clearAllData from BaseRedisRepository and update tests 2025-11-11 14:50:53 -08:00
b6b79e1345 Migrate ETA-related tests over to the ETA repository tests 2025-11-11 12:27:10 -08:00
e0b00d1887 Extract setupRouteAndOrderedStops to a test helper 2025-11-11 12:21:26 -08:00
c43201b867 Move RepositoryHolder into test helpers, as it's shared across shared tests 2025-11-11 10:59:20 -08:00
fb3be46ef2 Update shared test file and remove Redis-specific tests 2025-11-10 20:22:37 -08:00
4b4715cdb2 Add RedisShuttleRepository and ShuttleRepositorySharedTests, like pattern for parking data 2025-11-03 10:34:21 -08:00