You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Frontend fetch helpers frequently return empty arrays or null data after network and API failures. Several routes then render those fallbacks as legitimate empty states, zero statistics, an empty meal plan, or a redirect away from a missing recipe.
During an outage, users can therefore believe that recipes, inventory, account data, or meal plans were deleted. The application needs a consistent state model that distinguishes absence of data from inability to load it.
Scope
Define shared typed states for loading, empty, stale data, offline, temporary service failure, unauthorized, forbidden, not found, rate limited, and conflict.
Preserve the last known valid data where it is safe and clearly label it as stale.
Stop converting network errors and 5xx responses into valid empty collections.
Map 404 to a not-found experience only when the backend definitively returned not found.
Add route-level loading.tsx, error.tsx, and not-found.tsx coverage plus an appropriate global error boundary.
Add reusable retry, offline, and service-unavailable components.
Context
Frontend fetch helpers frequently return empty arrays or null data after network and API failures. Several routes then render those fallbacks as legitimate empty states, zero statistics, an empty meal plan, or a redirect away from a missing recipe.
During an outage, users can therefore believe that recipes, inventory, account data, or meal plans were deleted. The application needs a consistent state model that distinguishes absence of data from inability to load it.
Scope
5xxresponses into valid empty collections.404to a not-found experience only when the backend definitively returned not found.loading.tsx,error.tsx, andnot-found.tsxcoverage plus an appropriate global error boundary.401,403,404,409,429,5xx, timeout, interrupted requests, and offline transitions.Acceptance criteria
Related
Out of scope