marmelab/react-admin

[CRM Demo] When using modals for show and edit views, the data is not updated in show views

Closed this issue · 1 comments

What you were expecting:

In the CRM demo, when I save a deal, I expect the show view to update with the new data in optimistic mode.

What happened instead:

The updated content is first displayed, then removed by the older one, and the, once the update is persisted is shown back.

This problem exists only when two modals are used for edit and show views, it does not happen when saving from an edit page and redirects back to a show page.

Steps to reproduce:
Open the CRM demo, add a large delay on the data provider:

# crm/dataProvider.ts#L22
const baseDataProvider = fakeRestDataProvider(generateData(), true, 3000);

Then go to deals, and edit a deal.

Other information:

Capture.video.du.25-07-2024.17.03.35.webm

Environment

  • React-admin version: latest
  • Last version that did not exhibit the issue (if applicable):
  • React version: repo version
  • Browser: chrome

The solution applied in #10078 is to use pessimistic mode.