Skip to content

keep whatsapp session resident - #239

Merged
deathbyknowledge merged 2 commits into
mainfrom
fix/whatsapp-session-residency
Aug 4, 2026
Merged

keep whatsapp session resident#239
deathbyknowledge merged 2 commits into
mainfrom
fix/whatsapp-session-residency

Conversation

@deathbyknowledge

Copy link
Copy Markdown
Owner

Summary

  • keep one authenticated WhatsApp provider session instead of opening a replacement every ten minutes
  • use a 30-second Durable Object alarm to maintain residency and reconnect only unhealthy transports
  • add content-free ingress stage logs for transport-to-Gateway diagnosis
  • replace socket-replacement tests and update operator documentation

Why

The routine dual-session replacement path could leave an authenticated account without an active socket when WhatsApp closed the old session before the candidate authenticated. Recovery then waited for a later lifecycle event, which appeared to users as messages arriving minutes late.

Residency maintenance should preserve the healthy provider session. Baileys remains responsible for transport keepalives, while the account alarm keeps the Durable Object resident and the ordinary recovery path owns unhealthy reconnects.

Validation

  • npm run check in adapters/whatsapp
  • 10 test files passed
  • 59 tests passed
  • deployed to gsv-steve-channel-whatsapp and confirmed Cloudflare Worker version 37 serving successfully

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a2a56f59d5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread adapters/whatsapp/src/whatsapp-account.ts
@deathbyknowledge

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 9d361f38c2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@deathbyknowledge
deathbyknowledge merged commit fa39786 into main Aug 4, 2026
7 checks passed
@deathbyknowledge
deathbyknowledge deleted the fix/whatsapp-session-residency branch August 4, 2026 14:40
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