I have chat application using socket.io-client.
in which there is an custom socket event for delete chat message,
which is getting stop to listen after some period of time.
take a note after this issue occurs, listening for new message event works but issue is only with get_delete_message socket event.
have tried many solutions related to socket configuration at client side, but didn't work.
Also connection is properly managed and user is connected in socket as well, issue is just with the listening, event is emitted from server side as well.
tried to set socket configuration as below, but didn't get success.
socket = io(SOCKET_ENVIRONMENT, { transports: ['websocket'], allowUpgrades: false, pingTimeout: 5000, pingInterval: 25000, rejectUnauthorized: false });
Socket Event Listening code:
get_deleted_message(callback => { console.log("Listen Deleted Messages", callback); setDeleteMessageCB(callback); });
This issue could potentially be related to the server-side implementation of the "get_delete_message" socket event. It's possible that the server is not emitting the event correctly, or that there is an issue with the event-specific implementation on the server.
You may want to try debugging the server-side code to see if there are any issues there. Additionally, you could try adding specific error handling for this event listener to see if any errors are being thrown that could help you diagnose the issue.
Another potential issue could be related to the client-side implementation of the "get_delete_message" event listener. You could potentially try adding some error handling on the client-side to see if there are any issues there as well. For example, you could check if the callback function is defined before assigning it as the "DeleteMessageCB" function.
Finally, you could try adding some logging around the event listener initialization and execution to see if you can identify any patterns or commonalities between when the issue occurs.