Jatin917/riverside-clone
## 🐛 Bug Report: User Still Receives Notifications After Leaving the Session
Open
#7 opened on Jul 7, 2025
buggood first issuemonorepotypescript
Repository metrics
- Stars
- (4 stars)
- PR merge metrics
- (PR metrics pending)
Description
Description
When a user leaves a session in the Riverside.fm clone (via "Join Studio" flow), they are still receiving toast notifications when other participants leave the session. This behavior should not happen, as the user has already exited the meeting.
🔁 Steps to Reproduce
- User A creates a session using "Join Studio" and shares the session link with User B.
- User B joins the session.
- User A or B leaves the session.
- The user who already left still receives a toast notification like:
"User X has left the meeting".
✅ Expected Behavior
Once a user has left the session:
- They should be fully disconnected from the socket room.
- They should not receive any further real-time events or toast notifications related to that session.
❌ Actual Behavior
- The client who left the session is still receiving socket events and toast notifications about other users leaving.
- This creates a confusing user experience.
🧩 Possible Cause
- The issue seems related to incomplete disconnection from the socket room.
- The socket may not be properly removed from the room, or event listeners in wssServer.ts file may not be cleaned up on leaving the session.
🛠 Suggested Fix
Ensure that when a user leaves the session:
- Their socket is removed from the socket room.
- All socket event listeners related to the session are cleaned up.