Skip to content

Implement the Offline Resilience roadmap item: cache memberships for view-only offline access #242

Description

@Lakes41

Difficulty: Advanced
Type: feature

Background
"Offline Resilience: Advanced caching layer for viewing memberships without connectivity" is an explicitly unchecked Roadmap item in the README, and the app already uses TanStack Query for server-state management, which has built-in persistence support.

Problem
With no offline caching layer, losing connectivity means the membership dashboard, guild profiles, and role data are entirely unavailable, even though this data changes infrequently and is ideal for offline viewing.

Expected outcome
Core read data (memberships, guild profiles, assigned roles) remains viewable while offline, served from a persisted TanStack Query cache, with a clear "Offline — showing cached data as of [time]" indicator, and automatically refreshes once connectivity returns.

Suggested implementation

  • Integrate TanStack Query's persistence (@tanstack/query-persist-client-core with an AsyncStorage or MMKV persister appropriate for React Native) for the relevant query keys (memberships, guild profiles, roles) — exclude anything sensitive/session-related from persistence.
  • Add a network-status listener (@react-native-community/netinfo or Expo's equivalent) to detect offline state and disable/queue mutations while offline (QR access checks inherently require connectivity and should show a clear "requires internet" state rather than silently failing).
  • Add a persistent "Offline" banner with the last-synced timestamp when cached data is being shown.
  • On reconnect, trigger a refetch of stale queries automatically.
  • Add tests simulating offline/online transitions and verifying cached data renders correctly offline.

Acceptance criteria

  • Membership dashboard and guild profiles remain viewable offline using cached data
  • A clear offline indicator with last-synced time is shown
  • QR access checks (which require connectivity) show an explicit "requires internet" state rather than failing silently
  • Reconnecting triggers an automatic refresh
  • Tests cover offline/online transition behavior

Likely affected files/directories

  • src/ (query client setup, persistence config)
  • app/ (offline banner, affected screens)
  • tests/

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesOfficial Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewardsadvancedAdvanced difficulty tasks requiring significant domain knowledge and implementation effortfeatureNew feature, enhancement, or functional addition

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions