Motivation
The current in-memory SessionStore class in src/api/utils/sessionStore.js loses all sessions on restart and doesn't scale across multiple bot instances.
Code review findings: S-M5, A-H3, A-H5 (Priority: P3)
Scope
- Add
ioredis dependency
- Create
RedisSessionStore with the same interface as the current SessionStore
- Configure via
REDIS_URL environment variable
- Fall back to in-memory store when Redis is not configured
- Add TTL-based expiry in Redis (replace manual cleanup interval)
Key Files
src/api/utils/sessionStore.js — current in-memory implementation
Motivation
The current in-memory
SessionStoreclass insrc/api/utils/sessionStore.jsloses all sessions on restart and doesn't scale across multiple bot instances.Code review findings: S-M5, A-H3, A-H5 (Priority: P3)
Scope
ioredisdependencyRedisSessionStorewith the same interface as the currentSessionStoreREDIS_URLenvironment variableKey Files
src/api/utils/sessionStore.js— current in-memory implementation