Skip to content

feat: add WhatsApp auth retry#63

Open
don7panic wants to merge 1 commit intoqwibitai:mainfrom
don7panic:feat/authenticate-retry
Open

feat: add WhatsApp auth retry#63
don7panic wants to merge 1 commit intoqwibitai:mainfrom
don7panic:feat/authenticate-retry

Conversation

@don7panic
Copy link
Copy Markdown

Type of Change

  • enhancement - adds WhatsApp auth retry logic

Description

Added automatic reconnection handling for WhatsApp authentication:

{"level":50,"time":1770087396028,"pid":3709,"hostname":"Joe-Air.local","fullErrorNode":{"tag":"stream:error","attrs":{"code":"515"}},"msg":"stream errored out”}
  • Implements retry mechanism with configurable max attempts, default: 5.
  • Special handling for stream error (515) with detailed logging.

@don7panic don7panic requested a review from gavrielc as a code owner February 3, 2026 15:48
@don7panic don7panic force-pushed the feat/authenticate-retry branch from 5e7639a to 7146d45 Compare February 3, 2026 15:51
flux627 referenced this pull request in flux627/nanoclaw Feb 6, 2026
Automatic reconnection handling for 515 (restartRequired) during
WhatsApp authentication. Retries up to 5 times with a restarting guard
to prevent event-stacking.

Co-authored-by: jnv22 <jnv22@users.noreply.github.com>
From: https://github.com/gavrielc/nanoclaw/pull/63
@TomGranot
Copy link
Copy Markdown
Collaborator

@gavrielc Tom just finished a comprehensive Baileys deep-dive and wrote 38 WhatsApp connector tests (PR #182). Given that audit work, we think this PR's retry logic for 515 (restartRequired) disconnects is solid and worth merging — it handles a real reliability issue where WhatsApp servers periodically request client restarts. The diff is clean and only touches src/whatsapp-auth.ts. Recommending merge.

@Andy-NanoClaw-AI Andy-NanoClaw-AI added PR: Feature New feature or enhancement Status: Blocked Blocked by merge conflicts or dependencies labels Mar 5, 2026
@gavrielc gavrielc requested a review from gabi-simons as a code owner March 6, 2026 10:17
@Andy-NanoClaw-AI
Copy link
Copy Markdown
Collaborator

Hey @don7panic 👋 Thanks for this fix — WhatsApp auth reliability is critical!

This was superseded by #443 (merged), which fixed connection issues by switching to fetchLatestWaWebVersion(), covering the same auth reliability problem with a more complete solution. This PR also has merge conflicts with the current codebase.

We're adding Status: Pending Closure. Thanks for the contribution! 🙌

@Andy-NanoClaw-AI Andy-NanoClaw-AI added Status: Pending Closure PR flagged for closure during triage and removed Status: Pending Closure PR flagged for closure during triage labels Mar 7, 2026
@Andy-NanoClaw-AI
Copy link
Copy Markdown
Collaborator

Update: Apologies for the previous comment — I incorrectly flagged this as superseded by #443. After reviewing more carefully, #443 fixed a different issue (405 connection failure via fetchLatestWaWebVersion()), while this PR specifically handles stream error 515 (WhatsApp restartRequired disconnects) with retry logic. These are distinct reliability concerns.

Removing the Status: Pending Closure label. Tom's recommendation from Feb 12 stands — this is worth a proper review. @gabi-simons tagging you as requested.

kenansun-dev-bot bot pushed a commit to kenansun-dev/nanoclaw-github-copilot that referenced this pull request Apr 12, 2026
Linux: systemd user service + linger
Windows: Scheduled Task (fallback: Startup folder)
Optional: --devtunnel <id> registers devtunnel service too

Usage:
  nanoclaw service install [--devtunnel <tunnel-id>]
  nanoclaw service uninstall
  nanoclaw service status

344/344 tests pass.

Co-authored-by: Kenan VM Claw <vm-claw@kenan.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Feature New feature or enhancement Status: Blocked Blocked by merge conflicts or dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants