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

Refactor middlewares to handle optimistic cases #9875

Merged
merged 3 commits into from
May 27, 2024
Merged

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented May 23, 2024

Problem

By the time optimistic and undoable mutations dataProvider calls are really executed, the calling component might have been unmounted leading to the middlewares being unregistered and hence, not applied.

Solution

When the mutation is called, keep the current callbacks in a closure

@djhi djhi added RFR Ready For Review v5 labels May 23, 2024
@slax57 slax57 self-requested a review May 27, 2024 08:05
Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

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

💪

@slax57 slax57 merged commit 06e0ebc into next May 27, 2024
14 checks passed
@slax57 slax57 deleted the refactor-middlewares-2 branch May 27, 2024 09:40
@fzaninotto fzaninotto added this to the 5.0.0 milestone May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review v5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants