Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for offline/local first applications #10545

Open
wants to merge 10 commits into
base: next
Choose a base branch
from

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Feb 24, 2025

Problem

React-admin currently don't handle well the loss of network connectivity: in any demo, if you go to a list page, then simulate being offline using the devtool and try to go to the second page of the same list, it will still display the first page data while the pagination will indeed indicate you are on page 2.

Solution

How To Test

  • Open the simple example
  • Use the browser devtool to go offline
  • Click the posts create button and fill it
  • Go back to the posts list after and notice the new item is there
  • Open the devtool and note there is no create call to the dataProvider
  • Use the browser devtool to go online
  • Open the devtool and note there is a create call to the dataProvider

Follow the same step but edit a record instead of creating it.
Follow the same step for both edit and create but enter f00bar as the post title to trigger an error once the network is online.

Additional Checks

  • The PR targets master for a bugfix, 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

Also, please make sure to read the contributing guidelines.

@djhi djhi added the WIP Work In Progress label Feb 24, 2025
EditPostPage.setInputValue(
'input',
'title',
'Lorem Ipsum again{enter}'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because react-query now persist queries and mutations for offline mode, the previous test now leaks into the second (e.g. this post has its title changed to Lorem Ipsum). I tried to configure testIsolation in Cypress but our version is probably too old

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant