You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ReferenceField dispatches a CRUD_GET_MANY_ACCUMULATE action on load and subscribes to the store where the reference is supposed to be recorded. Until the store contains the reference, ReferenceField displays a loader. That's optimistic rendering at work.
The problem is: if the dataProvider fails, the store is never updated, and the loaded indicator is never cleared. It is troubling for both developers and end users.
Solution
We could update the aggregate saga to fix this: each CRUD_GET_MANY_ACCUMULATE action would contain a callback side effect to update the loading state on error, and the aggregate saga would also accumulate these callbacks and execute them all.
To be done in v3 because the code has changed so much for ReferenceFields that we'd need to develop it twice.
The text was updated successfully, but these errors were encountered:
Just to make sure I am on the right path. I modified the crudGetManyAccumulate to receive a callback and pass it to crudGetMany as an onFailure callback. In the useReference I will have an error flag that is updated when the failure callback is fired. If it is ok I will open a PR.
Problem
ReferenceField
dispatches a CRUD_GET_MANY_ACCUMULATE action on load and subscribes to the store where the reference is supposed to be recorded. Until the store contains the reference,ReferenceField
displays a loader. That's optimistic rendering at work.The problem is: if the dataProvider fails, the store is never updated, and the loaded indicator is never cleared. It is troubling for both developers and end users.
Solution
We could update the aggregate saga to fix this: each CRUD_GET_MANY_ACCUMULATE action would contain a callback side effect to update the loading state on error, and the aggregate saga would also accumulate these callbacks and execute them all.
To be done in v3 because the code has changed so much for ReferenceFields that we'd need to develop it twice.
The text was updated successfully, but these errors were encountered: