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.