Skip to content

Add offline reading and resilient cached content to the Expo app #317

Description

@ThatXliner

Goal

Make the Expo app useful and understandable when the device is offline or the network is unreliable, without showing a generic unrecoverable error screen.

MVP scope

  • Persist the last successfully loaded Browse results on-device.
  • Make previously opened bills, orders, cases, and briefings readable offline, including their summaries and source metadata.
  • Cache content images on disk when practical; missing images must not block the detail screen.
  • Show a clear offline/stale-data indicator and the time of the last successful refresh.
  • Let search operate over cached content, or clearly explain when a server-only result is unavailable.
  • Disable network-only actions with a specific explanation, or queue them safely for retry.
  • Refresh stale data after connectivity returns without discarding usable cached content.

Technical considerations

  • Choose and document the persistence layer (for example, persisted query cache for lightweight state and SQLite for durable searchable content).
  • Bound storage with a documented size limit plus TTL/LRU eviction.
  • Version the local schema/cache so app upgrades can migrate or safely invalidate it.
  • Keep credentials and privileged data out of the content cache.
  • Treat Supabase Storage images as independently cacheable assets rather than a prerequisite for rendering text.

Acceptance criteria

  • After one successful online session, a cold launch in airplane mode reaches Browse and displays cached results.
  • A previously opened content detail screen remains readable in airplane mode.
  • Offline, empty, stale, and retry states are visually distinct and accessible.
  • Reconnecting and refreshing replaces stale content without a restart.
  • Automated tests cover cache hydration/invalidation, and a physical-device smoke test covers cold launch offline, intermittent connectivity, and reconnect.

Out of scope

  • Downloading the entire corpus for offline use.
  • Offline submission of feedback unless a durable retry queue is explicitly included in the implementation.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions