Possible error may occur after creating a new user.
Steps to reproduce:
- Create a new user through the control panel Users section.
- Go to the Users list and find the user created in 1.
Correct result : the user is present in the list.
Possible wrong result : the user is not listed.***
***This is due to how [UserLocalServiceImpl's addUserWithWorkflow method handles the updated user after the workflow is applied. It returns the user object but it may not be updated correctly during the process (or another usr object has been updated during hibernate's merge operation). The safest and most reliable way to obtain the current updated user is to retrieve it from the persistence layer, which has been updated with the latest status in the updateStatus method.
Otherwise, for example, the user would be then indexed with a status = 2 (draft) and would not appear in the list.