Skip to content

Commit 3494764

Browse files
committed
fix: resolve race condition in NetworkDataCache with proper LRU implementation
- Replace O(n) array-based LRU with O(1) Map-based LRU using insertion order - Add stale-while-revalidate pattern for resilience during fetch failures - Add proper disposal pattern with Symbol.asyncDispose support - Extract magic numbers into named constants (CACHE_DEFAULTS) - Add comprehensive metrics tracking (hits, misses, evictions, staleHits) - Add ensureNotDisposed guard to prevent operations on disposed cache
1 parent 27cb401 commit 3494764

File tree

1 file changed

+207
-74
lines changed

1 file changed

+207
-74
lines changed

0 commit comments

Comments
 (0)