-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
If you call findByPrincipalName you can get inconstant results, as query listSessionsByPrincipalNameQuery used below does not order results by id. Later, extractor of the result is trying to combine results for the same sessions – but it's calling getLast on list that it's creating, so if results are not ordered, then result list of extractor might have multiple entries for same session. The problem is that later this list is converted to map by id – at this point we will loose some attributes.
To Reproduce
Have two sessions for the same principle name with multiple attributes. Call findByPrincipalName.
Expected behavior
Result should be ordered or extractor should not call getLast but actually look by an id. Also, extractor could return a Set in that case.