Skip to content

Offline catalogue browsing (local SQLite cache) #32

Description

@fabiodalez-dev

Problem

When the device is offline the app is unusable: every screen fails with Unable to resolve host "…": No address associated with hostname and only offers "Retry". Even browsing the already-loaded catalogue is impossible.

Goal

Make the catalogue (and the user's own library/favourites) browsable offline by caching it in a local SQLite/Room database, so the network is only required for actions that genuinely need it.

Approach

  • Local store: a Room/SQLite database mirroring books + covers + core metadata, populated on the first online sync.
  • Cache-first repository: read from the local DB, refresh in the background when connectivity is available. The current "Unable to resolve host" screen becomes a fallback only for the actions that truly need the network.
  • Offline-navigable: Catalogo, Libreria and Preferiti render from local data; Home shows the last-synced state.
  • Online-only actions (loan request, login, reservations) keep a clear "you're offline" state instead of a hard error.

Backend dependency

  • A bulk export / delta-sync endpoint (likely in the mobile-api plugin) so the client can download and incrementally update the catalogue efficiently (ETag / updated-since, paginated), rather than re-fetching everything.

Notes

  • Covers: cache thumbnails locally (size-bounded, LRU eviction).
  • Decide the sync trigger (app start, pull-to-refresh, periodic WorkManager).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions