Baileys: [BUG] creds.json broke after some reconnections.

Describe the bug Actually, i’ve been ignoring status codes diferent than 401 and reconecting the session. But after some reconnections the creds.json broke and the session is lost. But funny, when you fix the json the connection normalize again.

To Reproduce Steps to reproduce the behavior:

  1. Created a new connection
  2. Reconnect the session ignoring status codes diferent than 401

Expected behavior It was expected to maintan the session running.

Environment (please complete the following information):

  • Is this on a server? in pcs and servers too
  • What do your connectOptions look like? ´´´ { printQRInTerminal: true, auth: state, keepAliveIntervalMs: 999999, browser: Browsers.macOS(“Desktop”), syncFullHistory: false, logger: pino({ level: “fatal” }), linkPreviewImageThumbnailWidth: 852, generateHighQualityLinkPreview: true, options: { timeout: 15 * 1000, }, } ´´´
  • Do you have multiple clients on the same IP? Yes
  • Are you using a proxy? No

image

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 11
  • Comments: 35 (8 by maintainers)

Commits related to this issue

Most upvoted comments

👍🏽 Upvote! This issue deserves attention.

Good one! this is a serious issue. I had to make adjustments in my code to fix this like: when creds.json break it will show qr so if(s.qr) Delete the current session; pull the session from the saved server; restart. This is automated but the root of the problem is not fixed

Nice! After all, i’ve tested some ways to fix this. And you can fix the broken json by erasing all the characters after the penutimate brace. With the json fixed, you can just reconnect and all will work fine. You don’t need to read the qr_code again.

help me

Good one! this is a serious issue. I had to make adjustments in my code to fix this like: when creds.json break it will show qr so if(s.qr) Delete the current session; pull the session from the saved server; restart. This is automated but the root of the problem is not fixed

😯

Nice

help me🙂

Here you’re! @SheIITear have a look when you have time 🙏 https://github.com/WhiskeySockets/Baileys/pull/824