Skip to content

Fix duplicate undoable mutation commits on notification exit - #11345

Open
dawNotPoi wants to merge 1 commit into
marmelab:masterfrom
dawNotPoi:fix/11334-notification-exit-callback
Open

Fix duplicate undoable mutation commits on notification exit#11345
dawNotPoi wants to merge 1 commit into
marmelab:masterfrom
dawNotPoi:fix/11334-notification-exit-callback

Conversation

@dawNotPoi

Copy link
Copy Markdown

Problem

With MUI 6 and later, Notification passes the same onExited callback through both the legacy TransitionProps API and slotProps.transition. MUI invokes both callbacks, causing an undoable mutation to be committed twice.

Fixes #11334

Solution

Use TransitionProps and ContentProps only with MUI 5. For MUI 6 and later, use the slot props API exclusively while preserving the existing user prop override order.

How To Test

  • yarn jest packages/ra-ui-materialui/src/layout/Notification.spec.tsx --runInBand
  • yarn jest packages/ra-core/src/notification/useNotify.spec.tsx --runInBand
  • yarn workspace ra-core build
  • yarn workspace ra-ui-materialui build
  • yarn tsc --noEmit -p packages/ra-ui-materialui/tsconfig.json

Additional Checks

  • The PR targets master for a bug fix
  • The PR includes unit tests
  • No new story is required because this is internal transition wiring covered by the regression test
  • No documentation change is required because the public API is unchanged

@dawNotPoi
dawNotPoi marked this pull request as ready for review August 22, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant