Description
SimpleCache<K, V> (src/utils/cache.ts) implements TTL expiry (set/get/delete/clear/size, with per-entry and default TTLs), but has no test file exercising it — none of tests/utils.test.ts or any other test file references SimpleCache or utils/cache. Its expiry logic (Date.now() > entry.expiresAt, lazily evicting on get) is exactly the kind of time-dependent code that's easy to get subtly wrong (off-by-one on the boundary, forgetting to delete on expiry) without a test using fake timers.
Component
SDK
Difficulty
🟢 Easy
Tasks
Acceptance Criteria
Estimated Time
<1 day
Description
SimpleCache<K, V>(src/utils/cache.ts) implements TTL expiry (set/get/delete/clear/size, with per-entry and default TTLs), but has no test file exercising it — none oftests/utils.test.tsor any other test file referencesSimpleCacheorutils/cache. Its expiry logic (Date.now() > entry.expiresAt, lazily evicting onget) is exactly the kind of time-dependent code that's easy to get subtly wrong (off-by-one on the boundary, forgetting to delete on expiry) without a test using fake timers.Component
SDK
Difficulty
🟢 Easy
Tasks
tests/cache.test.tscoveringset/getround-trip,delete,clear,sizeMapongetAcceptance Criteria
tests/cache.test.tsexists and covers expiry behavior with fake timersEstimated Time
<1 day