You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We have a React Native app using Socket.io to communicate with our servers.
Some users experience a quirk whereby leaving the app doesn't fire a disconnect event on the server for a very long time (hours).
See screenshot of some of our logs:
This also occurs upon making a io.in([...]).fetchSockets() call: those sockets still look open.
To Reproduce
N/A
Socket.IO server version: 4.8.1
Server
import{Server}from"socket.io";constio=newSocketServer<ClientToServerEvents,ServerToClientEvents,{[event: string]: (...args: unknown[])=>void},SocketData>(server,{path: "/socket",serveClient: false,cookie: true,adapter: socketIoPubSubTopic
?
createAdapter(socketIoPubSubTopic)
: undefined,});if(socketIoPubSubTopic){awaitio.of("/").adapter.init();log.log("Pub/sub subscription initialized for Socket.IO");}io.on("connection",async(socket)=>{constuserId=socket.data.userId;log.log({ userId },`Socket connected for ${userId}`);if(userId){awaitupdateJoinedRooms(userId,socket);}socket.on("disconnect",()=>{log.log({ userId },`Socket disconnected for ${userId}`);});});
Describe the bug
We have a React Native app using Socket.io to communicate with our servers.
Some users experience a quirk whereby leaving the app doesn't fire a
disconnect
event on the server for a very long time (hours).See screenshot of some of our logs:
This also occurs upon making a
io.in([...]).fetchSockets()
call: those sockets still look open.To Reproduce
N/A
Socket.IO server version:
4.8.1
Server
Socket.IO client version:
4.8.1
Client
Expected behavior
To always get the disconnect event firing.
Platform:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: