WhiskeySockets / Baileys

Lightweight full-featured typescript/javascript WhatsApp Web API
https://baileys.whiskeysockets.io/
MIT License
3.79k stars 1.29k forks source link

[BUG] Sockt closes after 1-2 hours, requiring Node.js service restart #1078

Open mohamed-2010 opened 1 day ago

mohamed-2010 commented 1 day ago

Describe the issue: I am using Baileys to connect via WebSocket, but I've noticed that the connection closes after approximately one or two hours of being active. I need to restart my Node.js service to reconnect the socket.

Steps to reproduce:

  1. Start the WebSocket connection using Baileys.
  2. Leave it running for one to two hours.
  3. After some time, the connection is closed without error.
  4. Restarting the Node.js service reconnects the socket, but the issue happens again after a similar duration.

Expected behavior: The WebSocket should remain open indefinitely or reconnect automatically without requiring a full service restart.

Additional context:

I would appreciate any insights or suggestions on how to resolve this issue. Are there any built-in reconnection strategies or configurations to prevent frequent disconnections?

Thank you in advance for your help.

Skidy89 commented 2 hours ago

implement an automatic restart every 30 min

Skidy89 commented 2 hours ago

or simply use the logger debug to see whats happening