`Problem Description:
I am building an Omegle-like chat application that connects users after authentication. The app supports a skip functionality where a user can leave the current room and connect to a new user. The app works as follows:
A React frontend deployed on Vercel.
A Node.js backend deployed on Render (uses WebSocket for signaling via Socket.IO).
When a user clicks “Skip,” the client sends a request to leave the current room and connect to a new one.
However, I’m encountering these issues:
Inconsistent behavior: On localhost, the skip functionality sometimes works and sometimes doesn’t.
Deployment failure: On Vercel (frontend) and Render (backend), the skip functionality doesn’t work at all, but the backend logs show that new rooms are being created.
Previous Issues and Fixes:
Initially, I faced an issue where rapid refresh in React caused multiple Socket.IO instances to connect without disconnecting existing ones. This led to multiple socket connections. I mitigated this by:
Implementing lazy loading for Socket.IO.Specifying transport as “websocket”.This seemed to fix the multiple connection issue locally, but the skip issue persists, and I am not sure if this is the correct approach.
****Repositories and Deployed Links:
Frontend Repository: GitHub – Frontend
Backend Repository: GitHub – Backend
Frontend Deployment:VERCEL LINK
Backend Deployment: Render Link
Note: Please ensure to wake up the backend on Render before testing. Use the following credentials to test the app:**
Email: [email protected] Password: a12345**
⚠️⚠️⚠️I WANT SOMEONE WHO CAN FIX THIS SKIP ISSUE `
Kushik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.