Skip to content

feat: version-based cache invalidation (#260)#452

Open
abrak01 wants to merge 1 commit into
rinafcode:mainfrom
abrak01:feat/version-based-cache-invalidation
Open

feat: version-based cache invalidation (#260)#452
abrak01 wants to merge 1 commit into
rinafcode:mainfrom
abrak01:feat/version-based-cache-invalidation

Conversation

@abrak01
Copy link
Copy Markdown

@abrak01 abrak01 commented May 28, 2026

  • Add dataVersion field to in-memory CacheEntry; expose invalidateCacheByDataVersion() to evict entries by server version tag
  • Call clearCache() (in-memory) synchronously on major/minor app version bump before AsyncStorage and image cache are cleared
  • Invoke handleCacheVersionUpdate(appVersion) in App.tsx prepareApp so all caches are wiped before first data fetch on a version change
  • Add tests: clearCache called on bump, skipped on patch, ordering guarantee (in-memory before AsyncStorage), and full invalidateCacheByDataVersion suite in new cache.test.ts

Closes #260

- Add dataVersion field to in-memory CacheEntry; expose
  invalidateCacheByDataVersion() to evict entries by server version tag
- Call clearCache() (in-memory) synchronously on major/minor app version
  bump before AsyncStorage and image cache are cleared
- Invoke handleCacheVersionUpdate(appVersion) in App.tsx prepareApp so
  all caches are wiped before first data fetch on a version change
- Add tests: clearCache called on bump, skipped on patch, ordering
  guarantee (in-memory before AsyncStorage), and full
  invalidateCacheByDataVersion suite in new cache.test.ts

Closes rinafcode#260
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 28, 2026

@abrak01 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement version-based cache invalidation strategy

1 participant