Jatin917/riverside-clone

## 🐛 Bug Report: User Still Receives Notifications After Leaving the Session

开放

#7 创建于 2025年7月7日

 (0 条评论) (0 个反应) (0 位负责人)TypeScript (0 个派生)auto 404
buggood first issuemonorepotypescript

仓库指标

星标
 (4 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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

  1. User A creates a session using "Join Studio" and shares the session link with User B.
  2. User B joins the session.
  3. User A or B leaves the session.
  4. 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.

贡献者指南