fix(whatsapp): retry QR login 408 timeouts#88183
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 29, 2026, 9:12 PM ET / 01:12 UTC. Summary PR surface: Source +53, Tests +150. Total +203 across 4 files. Reproducibility: yes. at source level: current main retries the WhatsApp login socket only for 515, so a pre-QR 408 from waitForWaConnection falls through as a failed login. I did not run a live WhatsApp pairing flow in this read-only review. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the bounded 408 retry after maintainers either accept the mocked coverage for this channel bug or add live WhatsApp QR pairing proof for the replacement-socket path. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main retries the WhatsApp login socket only for 515, so a pre-QR 408 from waitForWaConnection falls through as a failed login. I did not run a live WhatsApp pairing flow in this read-only review. Is this the best way to solve the issue? Yes, with one validation caveat: the PR localizes the retry in the shared login wait helper, keeps 408 and 515 restart budgets separate, and wakes the QR flow from replacement sockets. Live Baileys proof would settle the remaining runtime risk. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against deb48a96fb8d. Label changesLabel justifications:
Evidence reviewedPR surface: Source +53, Tests +150. Total +203 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
c65c308 to
dc655e0
Compare
Summary
DisconnectReason.timedOut/ 408 before login completesRefs #47367.
Supersedes #47710.
Verification
Behavior addressed: WhatsApp QR-link login no longer treats the first pre-QR 408 opening-handshake timeout as an immediate terminal failure when a replacement socket can emit a QR.
Real environment tested: Local mocked WhatsApp/Baileys unit coverage in a fresh branch worktree.
Exact steps or command run after this patch:
Evidence after fix: Regression coverage proves one 408 timeout restart, persistent 408 exhaustion without socket churn, 408 followed by the existing 515 post-pairing restart, and returning a replacement QR when the first socket times out before emitting QR.
Observed result after fix: All commands above passed; autoreview reported no accepted/actionable findings.
What was not tested: No live WhatsApp device pairing run was performed.