Admin event send before actual updating the user

During integrate Keyclock 11.0.2 I faced with issue related to handling admin events. Description of the issue:
I use custom event handler to send events related to user updating to external service using HttpClient. But in case of editing users using admin cli I got event with not relevant user data. It occured because inside the update endpoint (, the event( is sent before the user attributes are validated and the user is actually saved (before transaction commit).

Such behavior wasn’t detected in case of user events( sending.

Is it expected behavior?
if so, how to filter events that occurred after the actual user save?

Thank in advise

1 Like

Found possible solution using session.getTransactionManager().enlistAfterCompletion(newTransaction);