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

Đang mở
#228 4 bình luận 2 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 9 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
58/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
backend-api-design

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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).

Ngôn ngữ chính
Go
Star
1k
Fork
610
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của evolution-foundation/evolution-go

Tất cả issue của evolution-foundation/evolution-go

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.