fix(whatsmeow): call store.SetWAVersion with dynamic webVersion to prevent 405 Client Outdated

未关闭
#228 4 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 9 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
58/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go

调研方向

Start with pkg/whatsmeow/service/whatsmeow.go, reading StartClient and fetchWhatsAppWebVersion() to see how the retrieved version reaches the device properties and the handshake. Check how store.SetWAVersion is used and verify the version values in both paths. Done means the Noise handshake uses the retrieved web version and connections no longer fail with 405; run the relevant Go tests.

由索引模型根据 Issue 内容生成。

描述

Problem Description

WhatsApp has deprecated client version 2.3000.1042386815 today (Nov 2, 2026), resulting in all connections failing during the WebSocket handshake with:

<failure location="frc" reason="405"/>
[Client ERROR] Client outdated (405) connect failure (client version: 2.3000.1042386815)
Root Cause

In pkg/whatsmeow/service/whatsmeow.go, the function fetchWhatsAppWebVersion() successfully retrieves the latest web version (e.g. 2.3000.1052769028), and sets store.DeviceProps.Version.

However, whatsmeow uses store.GetWAVersion() and store.BaseClientPayload.UserAgent.AppVersion for the Noise handshake payload, which remains hardcoded to the older version compiled into whatsmeow.

Because store.SetWAVersion was never invoked, WhatsApp's server rejects the connection with HTTP 405.

Proposed Solution

In pkg/whatsmeow/service/whatsmeow.go, call store.SetWAVersion(...) whenever the web version is determined or retrieved:

  1. In StartClient:
if version.Major != 0 && version.Minor != 0 && version.Patch != 0 {
    store.SetWAVersion(store.WAVersionContainer{uint32(version.Major), uint32(version.Minor), uint32(version.Patch)})
}
  1. Inside fetchWhatsAppWebVersion() when clientRevision > 0:
store.SetWAVersion(store.WAVersionContainer{2, 3000, uint32(clientRevision)})

We tested this patch in production and all instances immediately reconnected to WhatsApp Web without requiring re-pairing (no QR code needed).

主要语言
Go
星标
1k
派生
610
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

evolution-foundation/evolution-go 的其他 Issue

查看 evolution-foundation/evolution-go 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。