Skip to content

fix(baileys): preserve sessions on transient disconnects#2612

Open
SmartNuvem wants to merge 1 commit into
evolution-foundation:mainfrom
SmartNuvem:main
Open

fix(baileys): preserve sessions on transient disconnects#2612
SmartNuvem wants to merge 1 commit into
evolution-foundation:mainfrom
SmartNuvem:main

Conversation

@SmartNuvem

Copy link
Copy Markdown

Summary

This fixes a regression introduced in 2.4.0-rc2 where transient disconnects
(e.g. DisconnectReason 408) were treated as permanent session closures.

Changes

  • Restore automatic reconnect for transient disconnects (408).
  • Prevent instances from being persisted in close state after transient failures.
  • Serialize connection.update and creds.update to avoid race conditions.
  • Prevent concurrent reconnect timers.
  • Improve reconnect/disconnect logging.

Validation

Tested on a production-like environment:

  • Evolution API 2.4.0-rc2
  • PostgreSQL
  • Redis
  • Cloudflare reverse proxy

Before this patch, instances disconnected within the same day or the following day and remained in close.

After applying this patch, the instance has remained connected beyond the period where the issue consistently occurred, without requiring QR reconnection.

No database schema, licensing, Redis, or authentication behavior was modified.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @SmartNuvem, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant