Repository navigation
feat(home): add AsyncStorage feed cache for instant startup load (#895) - #1127
Merged
ONEONUORA merged 1 commit intoOct 19, 2026
Merged
Conversation
Cover the two-phase load (cache-first then network) introduced in home.tsx: - Cached items are shown immediately on mount before network responds - Fresh network data replaces cached items after a successful fetch - Empty cache gracefully falls back to INITIAL_FEED - AsyncStorage read errors are swallowed; INITIAL_FEED shown instead - Fetched items are written back to AsyncStorage after success - Network fetch errors leave existing cached items visible on screen - Empty network response does not overwrite a populated cache
|
@Peace-001 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #895
Implements local AsyncStorage caching for the home feed so content is visible instantly on app startup, before any network request completes.
What changed
mobileapp/app/(personal)/home.tsxFEED_CACHE_KEY = "feed_items_cache"constant.useEffectnow runs a two-phase load:feed_items_cachefrom AsyncStorage and immediately populates the feed state so users see content with zero network latency.fetchFeed), updates the feed state, and writes the result back to AsyncStorage for the next launch.onPullRefresh) also writes the latest data back to the cache.mobileapp/__tests__/homeCache.test.tsx(new)Seven focused tests covering every path through the caching logic:
INITIAL_FEEDwithout crashingAsyncStorage.getItemthrowsINITIAL_FEEDshownAsyncStorage[]Acceptance criteria
Testing