Avoid deleting old client sessions

Closes #41427

Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
This commit is contained in:
Alexander Schwartz 2025-08-28 14:59:19 +02:00 committed by GitHub
parent 7767717d17
commit 8d052f015b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 8 deletions

View File

@ -398,13 +398,8 @@ public class InfinispanUserSessionProvider implements UserSessionProvider, Sessi
return null;
}
AuthenticatedClientSessionAdapter clientAdapter = importClientSession((UserSessionAdapter) userSession, clientSession, getTransaction(offline),
return importClientSession((UserSessionAdapter<?>) userSession, clientSession, getTransaction(offline),
getClientSessionTransaction(offline), offline, true);
if (clientAdapter == null) {
persister.removeClientSession(userSession.getId(), client.getId(), offline);
}
return clientAdapter;
}
private AuthenticatedClientSessionEntity getClientSessionEntity(UUID id, boolean offline) {

View File

@ -125,9 +125,8 @@ public class ClientSessionPersistentChangelogBasedTransaction extends Persistent
SessionEntityWrapper<AuthenticatedClientSessionEntity> authenticatedClientSessionEntitySessionEntityWrapper = importClientSession(realm, client, userSession, clientSession, clientSessionId);
if (authenticatedClientSessionEntitySessionEntityWrapper == null) {
LOG.debugf("Client-session not imported from persister. It is going to be removed. userSessionId=%s, clientSessionId=%s, clientId=%s, offline=%s",
LOG.debugf("Client-session not imported from persister. userSessionId=%s, clientSessionId=%s, clientId=%s, offline=%s",
userSession.getId(), clientSessionId, client.getId(), offline);
persister.removeClientSession(userSession.getId(), client.getId(), offline);
}
return authenticatedClientSessionEntitySessionEntityWrapper;