Skip to content

fix(room): evict Redis room projections on session end - #459

Merged
kunal0137 merged 1 commit into
devfrom
fix/room-redis-eviction
Oct 22, 2026
Merged

kunal0137 merged 1 commit into
devfrom
fix/room-redis-eviction

Conversation

@kunal0137

Copy link
Copy Markdown
Contributor

Problem

Redis room projections outlived the session that loaded them and were never cleaned up.

Changes

UserSessionLoader.sessionDestroyed now calls RoomMessageStore.evictRedisProjections for every room in the session user's (and agent user's) roomHash. This runs on both explicit logout and session timeout, independent of cluster mode. It's best-effort: failures are logged, and evicted rooms reload from the database on next open.

Depends on

SEMOSS/Semoss#3184 (adds RoomMessageStore.evictRedisProjections and the TTL).

Testing (local Monolith + Redis)

Loaded a room (key present, TTL 3600), called /api/auth/logout/all. The log showed "has logged out to end session" and the key was gone.

On logout or session timeout, drop the Redis room projections for every
room the session (and its agent user) loaded. They reload from the
database on next open.
@kunal0137
kunal0137 requested a review from a team as a code owner October 22, 2026 21:22
@snyk-io

snyk-io Bot commented Oct 22, 2026

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@kunal0137
kunal0137 merged commit e7d12f4 into dev Oct 22, 2026
3 checks passed
@kunal0137
kunal0137 deleted the fix/room-redis-eviction branch October 22, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant