project_chat_application
project_chat_application copied to clipboard
Socket connection and listeners are never cleaned up (memory leak/duplicate events)
In client/src/components/Chat/Chat.js, the socket connection is created in a useEffect without a cleanup. Event listeners are also registered without off() on unmount. Navigating in and out of the chat can create duplicate listeners and multiple connections.