Skip to content

findByPrincipalName does not correctly return sessions #3452

@dadeloper

Description

@dadeloper

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions