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
This commit is contained in:
@@ -31,7 +31,7 @@ class RedisShuttleRepositoryHolder implements RepositoryHolder<ShuttleGetterSett
|
||||
url: process.env.REDIS_URL,
|
||||
});
|
||||
await this.redisClient.connect();
|
||||
this.repo = new RedisShuttleRepository(this.redisClient);
|
||||
this.repo = new RedisShuttleRepository(this.redisClient, 0.001, 'test-system');
|
||||
return this.repo;
|
||||
};
|
||||
teardown = async () => {
|
||||
|
||||
Reference in New Issue
Block a user