fix(rooms): cleanup edge case for 1hr ttl#3163
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@cursor review |
Greptile OverviewGreptile SummarySummaryThis PR addresses an edge case where a socket entry can expire via the 1-hour TTL before the corresponding room presence is cleaned up, leaving stale presence in rooms. The changes appear to add cleanup paths in the socket connection/workflow handlers and adjust the room managers/types/feature-flag configuration so that presence is removed when the underlying socket mapping is missing or has been evicted. Overall, the change fits into the existing socket/rooms architecture by extending the room Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant SocketHandlers as Socket Handlers
participant Rooms as Rooms Manager
participant Redis as Redis (sockets + presence)
Client->>SocketHandlers: Connect / Resume
SocketHandlers->>Redis: Read socket entry (TTL-backed)
alt socket entry present
SocketHandlers->>Rooms: Join / update presence
Rooms->>Redis: Write presence
else socket entry missing (expired by 1hr TTL)
SocketHandlers->>Rooms: Cleanup presence for stale socket
Rooms->>Redis: Remove presence + room membership
end
Client->>SocketHandlers: Workflow events
SocketHandlers->>Redis: Resolve socket entry
alt missing/expired
SocketHandlers->>Rooms: Cleanup stale presence
Rooms->>Redis: Remove presence
else present
SocketHandlers->>Rooms: Update presence
Rooms->>Redis: Persist presence
end
|
|
@cursor review |
Summary
If sockets entry got cleaned up by 1hr ttl -- room presence would not be cleaned.
Type of Change
Testing
Tested manually using redis cli
Checklist