fix(whatsapp): stop reconnecting quiet sockets#72145
Conversation
🔒 Aisle Security AnalysisWe found 1 potential security issue(s) in this PR:
1. 🔵 Potential event-storm DoS via unthrottled WebSocket 'frame' listener
Description
Vulnerable code: const noteActivity = () => this.noteTransportActivity();
ws.on("frame", noteActivity);RecommendationAvoid per-frame listeners or throttle updates. Options:
private attachTransportActivityListener(sock: WASocket): (() => void) | null {
const ws = sock.ws as SocketActivityEmitter | undefined;
if (!ws || typeof ws.on !== "function") return null;
let lastNoted = 0;
const minIntervalMs = 250; // tune as needed
const noteActivity = () => {
const now = Date.now();
if (now - lastNoted < minIntervalMs) return;
lastNoted = now;
this.noteTransportActivity(now);
};
ws.on("frame", noteActivity);
return () => {
if (typeof ws.off === "function") ws.off("frame", noteActivity);
else ws.removeListener?.("frame", noteActivity);
};
}This preserves the watchdog signal while limiting callback frequency under frame storms. Analyzed PR: #72145 at commit Last updated on: 2026-04-26T12:05:43Z |
Greptile SummaryThis PR changes the WhatsApp watchdog timer to track WebSocket transport-frame activity ( Confidence Score: 4/5Safe to merge; one minor cleanup gap in the error path. Only a P2 finding: the catch block in extensions/whatsapp/src/connection-controller.ts — catch block cleanup around line 399–407.
|
|
ProjectClownfish follow-up addressed the bot review items in efae4af:
Validation:
|
Summary
Canonical issue
Fixes #70678.
Related: #53698, #65215, #71466, #63939.
Validation
Notes
This replacement exists because #71466 is draft, dirty/unmergeable, has skipped validation checks, and cannot be safely updated automatically; #63939 is useful but does not fix the bad production default by itself.
ProjectClownfish replacement details: