Join the discussion on Telegram
Why this matters
backend/src/lib/redis.ts includes a hand-rolled MemoryCache class with set/get/del/cleanup/getStats and a 60-second sweep. No tests for the cache itself.
This is the cache that fronts admin metrics, the claimable-amount fingerprinting, and the user-summary cache (indirectly). A bug here silently inflates RPC cost or stale data.
Acceptance criteria
Files to touch
- new
backend/tests/memory-cache.test.ts
Out of scope
- Testing the Redis publisher/subscriber lifecycle
Join the discussion on Telegram
Why this matters
backend/src/lib/redis.tsincludes a hand-rolledMemoryCacheclass with set/get/del/cleanup/getStats and a 60-second sweep. No tests for the cache itself.This is the cache that fronts admin metrics, the claimable-amount fingerprinting, and the user-summary cache (indirectly). A bug here silently inflates RPC cost or stale data.
Acceptance criteria
backend/tests/memory-cache.test.ts(Vitest)cleanup(),del()removes an entry,getStats()reflects hits/misses/itemCount,getMetadata()returns ISO timestampsvi.useFakeTimers) to advance timeFiles to touch
backend/tests/memory-cache.test.tsOut of scope