Context
CacheManager returns stale data immediately during revalidation but does not notify the consumer when background revalidation completes with fresh data.
Goal
Notification mechanism so reactive UIs can update when fresh data arrives.
Implementation
- Add optional
onRevalidate callback to cache config
- Call with fresh data when background fetch completes
- Alternative: return
{ data, revalidating: Promise } tuple
Files
src/cache/CacheManager.ts
tests/cache/CacheManager.test.ts
Source: AUDIT4 (-1 Defense-in-Depth)
Context
CacheManager returns stale data immediately during revalidation but does not notify the consumer when background revalidation completes with fresh data.
Goal
Notification mechanism so reactive UIs can update when fresh data arrives.
Implementation
onRevalidatecallback to cache config{ data, revalidating: Promise }tupleFiles
src/cache/CacheManager.tstests/cache/CacheManager.test.tsSource: AUDIT4 (-1 Defense-in-Depth)