KEYCLOAK-18737 Show sessions functionality does not work consistently

Co-authored-by: Pavel Bezdienezhnykh
Co-authored-by: Martin Kanis <mkanis@redhat.com>
This commit is contained in:
Martin Kanis 2021-10-12 09:21:12 +02:00 committed by Hynek Mlnařík
parent dacf28af84
commit d069ec7949

View file

@ -370,7 +370,7 @@ public class InfinispanUserSessionProvider implements UserSessionProvider {
// return a stream that 'wraps' the infinispan cache stream so that the cache stream's elements are read one by one
// and then mapped locally to avoid serialization issues when trying to manipulate the cache stream directly.
return StreamSupport.stream(cache.entrySet().stream().filter(predicate).spliterator(), true)
return StreamSupport.stream(cache.entrySet().stream().filter(predicate).spliterator(), false)
.map(Mappers.userSessionEntity())
.map(entity -> this.wrap(realm, entity, offline));
}
@ -439,7 +439,7 @@ public class InfinispanUserSessionProvider implements UserSessionProvider {
// return a stream that 'wraps' the infinispan cache stream so that the cache stream's elements are read one by one
// and then filtered/mapped locally to avoid serialization issues when trying to manipulate the cache stream directly.
Stream<UserSessionEntity> stream = StreamSupport.stream(cache.entrySet().stream().filter(predicate).spliterator(), true)
Stream<UserSessionEntity> stream = StreamSupport.stream(cache.entrySet().stream().filter(predicate).spliterator(), false)
.map(Mappers.userSessionEntity())
.sorted(Comparators.userSessionLastSessionRefresh());