Skip to content

Fix offline#11161

Open
fzaninotto wants to merge 1 commit intomasterfrom
offline-example
Open

Fix offline#11161
fzaninotto wants to merge 1 commit intomasterfrom
offline-example

Conversation

@fzaninotto
Copy link
Member

@fzaninotto fzaninotto commented Feb 12, 2026

Problem

Offline apps behave in a strange way, sometimes showing error pages even though they should not.

The offline mode of TanStack Query works fine in a standalone example, so the problems come from react-admin.

Solution

Build a demo, track down the issues and fix them.

When offline, all calls to useQuery return an error... but they also return data.

In a nutshell, we must not only check for errors before deciding to show/return things but also that no data is available for offline support to work correctly

  •  Fix useReference
  • Fix ReferenceField
  • Fix ListView
  • Test on a larger app (e.g. Atomic CRM)

If we have a NetworkError and valid data, it means we're offline and that TanStack query returned stale data.

How To Test

  • build
  • yarn preview

(the offline mode doesn't work in dev mode, that's a limitation of vite-pwa)

Describe the steps required to test the changes

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

@fzaninotto fzaninotto added the WIP Work In Progress label Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Work In Progress

Development

Successfully merging this pull request may close these issues.

2 participants