The Room That Won’t Leave
The team room works normally when first opened. After users visit other screens and return a few times, each teammate update produces several notifications. People also receive room notifications after they have left the room.
The bug report
You get the whole project — a React front end, an Express API, and Mongoose models — opened in a browser editor. Reproduce the symptom by reading the code, change what’s wrong, and run the hidden tests to prove it.
What the fix must prove
- loads the member directory from the API
- persists a member status change
- rejects unsupported presence states
- delivers each valid presence event to an active screen
- stops delivery after unmount and avoids duplicate subscriptions on return