Skip to content

fix: use fetchLatestWaWebVersion to prevent 405 connection failures#443

Merged
gavrielc merged 1 commit intoqwibitai:mainfrom
LorenzoFrankel:fix/wa-version-mismatch
Feb 24, 2026
Merged

fix: use fetchLatestWaWebVersion to prevent 405 connection failures#443
gavrielc merged 1 commit intoqwibitai:mainfrom
LorenzoFrankel:fix/wa-version-mismatch

Conversation

@LorenzoFrankel
Copy link
Copy Markdown
Contributor

Summary

  • Baileys' default WhatsApp Web version falls behind when WhatsApp updates their protocol, causing 405 "Method Not Allowed" errors on the websocket handshake
  • This prevents both new authentication (pairing/QR) and reconnection after a disconnect
  • Now calls fetchLatestWaWebVersion() before creating the socket so it always uses a current version

Files changed

  • src/channels/whatsapp.ts — runtime connection
  • src/whatsapp-auth.ts — setup auth flow

Test plan

  • Reproduced 405 error on fresh auth attempt
  • Applied fix, successfully authenticated via pairing code
  • Service starts and maintains stable WhatsApp connection
  • Verified on both macOS and Linux (Hetzner VPS)

🤖 Generated with Claude Code

Copy link
Copy Markdown
Collaborator

@gavrielc gavrielc left a comment

Choose a reason for hiding this comment

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

Clutch fix. Gonna merge and then add a catch. Thanks!

Baileys' default WhatsApp version can fall behind when WhatsApp updates
their protocol, causing 405 "Method Not Allowed" errors on the websocket
handshake. This prevents both new authentication and reconnection.

Now fetches the latest version on each connection so it stays current.

Applied to both the runtime connection (whatsapp.ts) and the setup auth
flow (whatsapp-auth.ts).
@gavrielc gavrielc force-pushed the fix/wa-version-mismatch branch from d4e4a47 to b36fb5f Compare February 24, 2026 04:56
@gavrielc gavrielc merged commit ec176a0 into qwibitai:main Feb 24, 2026
gavrielc added a commit that referenced this pull request Feb 24, 2026
The fetchLatestWaWebVersion call added in #443 could crash the
connection flow if the HTTP fetch fails. Wrap with .catch() to log
and fall back to the default Baileys version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@LorenzoFrankel
Copy link
Copy Markdown
Contributor Author

Sick! Happy I could help

Peyton-Spencer added a commit to omniaura/omniclaw that referenced this pull request Feb 24, 2026
- Port fetchLatestWaWebVersion fix from upstream qwibitai/nanoclaw#443
  to prevent 405 "Method Not Allowed" errors when Baileys' hardcoded
  WA Web version falls behind WhatsApp's current protocol
- Add exponential backoff to WhatsApp reconnect (3s → 6s → 12s … 5min cap)
  instead of retrying immediately, which was hammering WA servers and
  causing rate limiting that blocked re-authentication

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Peyton-Spencer added a commit to omniaura/omniclaw that referenced this pull request Feb 24, 2026
- Port fetchLatestWaWebVersion fix from upstream qwibitai/nanoclaw#443
  to prevent 405 "Method Not Allowed" errors when Baileys' hardcoded
  WA Web version falls behind WhatsApp's current protocol
- Add exponential backoff to WhatsApp reconnect (3s → 6s → 12s … 5min cap)
  instead of retrying immediately, which was hammering WA servers and
  causing rate limiting that blocked re-authentication

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
vedtam pushed a commit to vedtam/nanoclaw that referenced this pull request Feb 26, 2026
…wibitai#443)

Baileys' default WhatsApp version can fall behind when WhatsApp updates
their protocol, causing 405 "Method Not Allowed" errors on the websocket
handshake. This prevents both new authentication and reconnection.

Now fetches the latest version on each connection so it stays current.

Applied to both the runtime connection (whatsapp.ts) and the setup auth
flow (whatsapp-auth.ts).
TwinXu pushed a commit to TwinXu/nanoclaw that referenced this pull request Feb 28, 2026
…wibitai#443)

Baileys' default WhatsApp version can fall behind when WhatsApp updates
their protocol, causing 405 "Method Not Allowed" errors on the websocket
handshake. This prevents both new authentication and reconnection.

Now fetches the latest version on each connection so it stays current.

Applied to both the runtime connection (whatsapp.ts) and the setup auth
flow (whatsapp-auth.ts).
TwinXu pushed a commit to TwinXu/nanoclaw that referenced this pull request Feb 28, 2026
The fetchLatestWaWebVersion call added in qwibitai#443 could crash the
connection flow if the HTTP fetch fails. Wrap with .catch() to log
and fall back to the default Baileys version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ManveerBhullar pushed a commit to ManveerBhullar/nanoclaw that referenced this pull request Mar 1, 2026
…wibitai#443)

Baileys' default WhatsApp version can fall behind when WhatsApp updates
their protocol, causing 405 "Method Not Allowed" errors on the websocket
handshake. This prevents both new authentication and reconnection.

Now fetches the latest version on each connection so it stays current.

Applied to both the runtime connection (whatsapp.ts) and the setup auth
flow (whatsapp-auth.ts).
ManveerBhullar pushed a commit to ManveerBhullar/nanoclaw that referenced this pull request Mar 1, 2026
The fetchLatestWaWebVersion call added in qwibitai#443 could crash the
connection flow if the HTTP fetch fails. Wrap with .catch() to log
and fall back to the default Baileys version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
index-engine pushed a commit to index-engine/nanoclaw that referenced this pull request Mar 1, 2026
…wibitai#443)

Baileys' default WhatsApp version can fall behind when WhatsApp updates
their protocol, causing 405 "Method Not Allowed" errors on the websocket
handshake. This prevents both new authentication and reconnection.

Now fetches the latest version on each connection so it stays current.

Applied to both the runtime connection (whatsapp.ts) and the setup auth
flow (whatsapp-auth.ts).
index-engine pushed a commit to index-engine/nanoclaw that referenced this pull request Mar 1, 2026
The fetchLatestWaWebVersion call added in qwibitai#443 could crash the
connection flow if the HTTP fetch fails. Wrap with .catch() to log
and fall back to the default Baileys version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bagelagent pushed a commit to bagelagent/nanoclaw that referenced this pull request Mar 3, 2026
…wibitai#443)

Baileys' default WhatsApp version can fall behind when WhatsApp updates
their protocol, causing 405 "Method Not Allowed" errors on the websocket
handshake. This prevents both new authentication and reconnection.

Now fetches the latest version on each connection so it stays current.

Applied to both the runtime connection (whatsapp.ts) and the setup auth
flow (whatsapp-auth.ts).
bagelagent pushed a commit to bagelagent/nanoclaw that referenced this pull request Mar 3, 2026
The fetchLatestWaWebVersion call added in qwibitai#443 could crash the
connection flow if the HTTP fetch fails. Wrap with .catch() to log
and fall back to the default Baileys version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jenskock pushed a commit to jenskock/nanoclaw that referenced this pull request Mar 6, 2026
…wibitai#443)

Baileys' default WhatsApp version can fall behind when WhatsApp updates
their protocol, causing 405 "Method Not Allowed" errors on the websocket
handshake. This prevents both new authentication and reconnection.

Now fetches the latest version on each connection so it stays current.

Applied to both the runtime connection (whatsapp.ts) and the setup auth
flow (whatsapp-auth.ts).
jenskock pushed a commit to jenskock/nanoclaw that referenced this pull request Mar 6, 2026
The fetchLatestWaWebVersion call added in qwibitai#443 could crash the
connection flow if the HTTP fetch fails. Wrap with .catch() to log
and fall back to the default Baileys version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bebekim pushed a commit to bebekim/goodclaw that referenced this pull request Mar 14, 2026
…wibitai#443)

Baileys' default WhatsApp version can fall behind when WhatsApp updates
their protocol, causing 405 "Method Not Allowed" errors on the websocket
handshake. This prevents both new authentication and reconnection.

Now fetches the latest version on each connection so it stays current.

Applied to both the runtime connection (whatsapp.ts) and the setup auth
flow (whatsapp-auth.ts).
bebekim pushed a commit to bebekim/goodclaw that referenced this pull request Mar 14, 2026
The fetchLatestWaWebVersion call added in qwibitai#443 could crash the
connection flow if the HTTP fetch fails. Wrap with .catch() to log
and fall back to the default Baileys version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
squarewings pushed a commit to squarewings/nanoclaw that referenced this pull request Mar 15, 2026
…wibitai#443)

Baileys' default WhatsApp version can fall behind when WhatsApp updates
their protocol, causing 405 "Method Not Allowed" errors on the websocket
handshake. This prevents both new authentication and reconnection.

Now fetches the latest version on each connection so it stays current.

Applied to both the runtime connection (whatsapp.ts) and the setup auth
flow (whatsapp-auth.ts).
squarewings pushed a commit to squarewings/nanoclaw that referenced this pull request Mar 15, 2026
The fetchLatestWaWebVersion call added in qwibitai#443 could crash the
connection flow if the HTTP fetch fails. Wrap with .catch() to log
and fall back to the default Baileys version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
onlyforart referenced this pull request in onlyforart/nanoclaw Mar 27, 2026
…443)

Baileys' default WhatsApp version can fall behind when WhatsApp updates
their protocol, causing 405 "Method Not Allowed" errors on the websocket
handshake. This prevents both new authentication and reconnection.

Now fetches the latest version on each connection so it stays current.

Applied to both the runtime connection (whatsapp.ts) and the setup auth
flow (whatsapp-auth.ts).
onlyforart referenced this pull request in onlyforart/nanoclaw Mar 27, 2026
The fetchLatestWaWebVersion call added in #443 could crash the
connection flow if the HTTP fetch fails. Wrap with .catch() to log
and fall back to the default Baileys version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dm-j pushed a commit to dm-j/nanoclaw that referenced this pull request Apr 13, 2026
…wibitai#443)

Baileys' default WhatsApp version can fall behind when WhatsApp updates
their protocol, causing 405 "Method Not Allowed" errors on the websocket
handshake. This prevents both new authentication and reconnection.

Now fetches the latest version on each connection so it stays current.

Applied to both the runtime connection (whatsapp.ts) and the setup auth
flow (whatsapp-auth.ts).
dm-j pushed a commit to dm-j/nanoclaw that referenced this pull request Apr 13, 2026
The fetchLatestWaWebVersion call added in qwibitai#443 could crash the
connection flow if the HTTP fetch fails. Wrap with .catch() to log
and fall back to the default Baileys version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants