Commit Graph

2804 Commits

Author SHA1 Message Date
Renato Alcara cdab2e3c63 fix: address PR review — stale comments, createCallLink compat, relay guard
- Fix call link URL: remove media prefix (Frida shows https://call.whatsapp.com/<token>)
- Make createCallLink() backward compatible with chats.ts signature (event, timeoutMs)
- Guard CB:relay handler — require both callId AND callCreator before emitting
- Extract extractParticipants() helper to eliminate 3x code duplication

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 12:17:17 -03:00
Renato Alcara 3535a16b32 fix: address audit findings in call signaling implementation
- Fix handleCall to process ALL children of <call> node (not just first)
- Add CB:relay handler for top-level relay stanzas (TURN servers, tokens)
- Add 'video' and 'relay' to WACallUpdateType and getCallStatusFromNode
- Add <device-identity /> to voice call offers (verified via Frida capture)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:33:25 -03:00
Renato Alcara 919bc52c77 feat: complete call signaling — types, status handling, call link parsing
Complete the call signaling implementation with proper type definitions,
status handling, and call link URL construction:

- WACallEvent: add linkToken, linkCreator, participants, media, duration,
  terminateReason, connectedLimit fields
- WACallParticipant: new type for group/link call participants
- WACallUpdateType: add preaccept, transport, relaylatency, group_update,
  reminder, heartbeat, mute_v2, enc_rekey status types
- getCallStatusFromNode: handle all new call node tags
- handleCall: extract group_info, link_info, call_summary, participants
  from incoming call link/group stanzas
- createCallLink: parse server response to return token and full URL
  (https://call.whatsapp.com/video/<token>)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:20:32 -03:00
Renato Alcara 46622bd8c1 feat: implement complete call signaling from Frida captures
Add all remaining call signaling functions verified via Frida capture
on WhatsApp Android v2.26:

- acceptCall(): answer an incoming call with audio/video capabilities
- preacceptCall(): signal device capabilities before accepting
- sendRelayLatency(): report relay server latency measurements
- sendTransport(): send p2p/ICE transport candidates
- sendCallDuration(): log call duration to server after hangup
- muteCall(): mute/unmute during active call (MUTE_V2)
- sendHeartbeat(): keep group call alive
- sendEncRekey(): encryption re-key during call
- sendVideoState(): toggle video on/off during call

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:14:39 -03:00
Renato Alcara 664964216c feat: add call link support (create, query, join)
Add createCallLink(), queryCallLink(), and joinCallLink() functions
for WhatsApp call link feature. Stanza structures verified via Frida
capture on WhatsApp Android v2.26.

- createCallLink(media) creates a shareable call link
- queryCallLink(token, media) queries call info before joining
- joinCallLink(token, media) joins a call via its link token
  with proper audio/video/net/capability child nodes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:10:12 -03:00
Renato Alcara 1bbcebc59c feat: add offerCall and terminateCall for call signaling
Add outgoing call support with offerCall() and terminateCall() functions.
Stanza structures verified via Frida captures on WhatsApp Android v2.26,
matching real voice and video call flows.

- offerCall(jid, isVideo?) sends call offer with correct child nodes
  (privacy, audio×2, video if applicable, net, capability, enc, encopt)
- terminateCall(callId, callTo, ...) sends call termination with optional
  reason and duration attributes
- Both functions exported from the socket chain

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:06:21 -03:00
Renato Alcara 569e43f184 fix: use MACOS platform to resolve 405 connection failure (#244)
fix: use MACOS platform to resolve 405 connection failure
2026-03-01 10:00:20 -03:00
Renato Alcara 79ee40037b fix: add timeout to fetchLatestBaileysVersion to prevent hanging conn… (#243)
* fix: add timeout to fetchLatestBaileysVersion to prevent hanging connections

AbortController with 5s default timeout prevents indefinite blocking
when GitHub is unreachable (DNS failure, network issues). Falls back
to bundled version via existing catch block. Ref: Baileys#2385.


* fix: move clearTimeout to finally block in fetchLatestBaileysVersion

Ensures timer cleanup on both success and fetch rejection paths,
preventing dangling timers when DNS/network fails before abort fires.
2026-03-01 09:41:43 -03:00
Renato Alcara f032c9b0ea fix: normalise remoteJid in reaction/poll keys for fromMe messages (#240)
In DMs, when the connected user sends a reaction, the inner key's
remoteJid could remain unnormalized (e.g. LID vs PN), preventing
correct matching with the original message. Also normalises participant
in groups for own messages — an improvement over upstream Baileys#2386.
2026-03-01 08:46:09 -03:00
Renato Alcara 3d79b8fc36 chore: update WhatsApp Web version to v2.3000.1034279434 (#242)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-01 06:06:04 -03:00
github-actions[bot] f6e976f182 chore: update proto/version to v2.3000.1034274421 (#241)
Co-authored-by: rsalcara <rsalcara@users.noreply.github.com>
2026-03-01 00:49:55 -03:00
Renato Alcara 3d9d7bafe4 perf: reduce message delivery latency across all connection scenarios (#239)
perf: reduce message delivery latency across all connection scenarios (#239)
2026-02-28 17:26:40 -03:00
Renato Alcara 97336fc5cf chore: update WhatsApp Web version to v2.3000.1034258243 (#238)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-28 06:04:30 -03:00
github-actions[bot] cb6a90012f chore: update proto/version to v2.3000.1034238531 (#237)
Co-authored-by: rsalcara <rsalcara@users.noreply.github.com>
2026-02-28 00:33:51 -03:00
Renato Alcara 2faa107549 fix(latency): resolve message delivery slowness on restart and fresh
fix(latency): resolve message delivery slowness on restart and fresh
2026-02-27 11:57:16 -03:00
Renato Alcara d233a7856f fix: eliminate 40s message delivery delay caused by libsignal console dumps
fix: eliminate 40s message delivery delay caused by libsignal console dumps
2026-02-27 08:43:54 -03:00
Renato Alcara efc927728b chore: update WhatsApp Web version to v2.3000.1034187832 (#234)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-27 06:12:42 -03:00
github-actions[bot] 40d3678659 chore: update proto/version to v2.3000.1034172552 (#233)
Co-authored-by: rsalcara <rsalcara@users.noreply.github.com>
2026-02-27 00:45:05 -03:00
Renato Alcara 73682d40c6 perf(signal): eliminate 3 post-restart latency sources in migrateSession
perf(signal): eliminate 3 post-restart latency sources in migrateSession
2026-02-27 00:12:29 -03:00
Renato Alcara d73f2d0fc3 fix(retry): resolve message delivery speed
fix(retry): resolve message delivery speed
2026-02-26 22:09:18 -03:00
Renato Alcara 416ad47789 fix(retry): resolve message-not-found
fix(retry): resolve message-not-found
2026-02-26 19:29:38 -03:00
Renato Alcara 9c1adfd05f perf(reconnect): eliminate race condition between connection:open and offline message delivery
perf(reconnect): eliminate race condition between connection:open and offline message delivery
2026-02-26 18:54:19 -03:00
Renato Alcara 8cdea36b98 chore: update WhatsApp Web version to v2.3000.1034108780 (#227)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-26 06:15:24 -03:00
github-actions[bot] fa417f2a6d chore: update proto/version to v2.3000.1034095029 (#226)
Co-authored-by: rsalcara <rsalcara@users.noreply.github.com>
2026-02-26 00:46:17 -03:00
Renato Alcara 979ef19228 fix(retry): resolve message-not-found for device-specific JID retry receipts
fix(retry): resolve message-not-found for device-specific JID retry receipts
2026-02-25 22:22:03 -03:00
Renato Alcara f2c4e466ef fix(retry): resolve message-not-found for device-specific JID retry receipts
fix(retry): resolve message-not-found for device-specific JID retry receipts
2026-02-25 21:56:36 -03:00
Renato Alcara 8a744801c4 perf(inbound-latency): reduce buffer timeouts to fix slow inbound
perf(inbound-latency): reduce buffer timeouts to fix slow inbound
2026-02-25 20:57:23 -03:00
Renato Alcara f688f00695 perf: fix slow message delivery and post-restart connection latency
perf: fix slow message delivery and post-restart connection latency
2026-02-25 20:15:14 -03:00
Renato Alcara c39bda3720 chore: update WhatsApp Web version to v2.3000.1034014848 (#221)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-25 06:16:14 -03:00
Renato Alcara f4daa9197d fix: clear stale routingInfo on restart to prevent slow/unstable connections
fix: clear stale routingInfo on restart to prevent slow/unstable connections
2026-02-25 01:49:25 -03:00
Renato Alcara be34c5136d fix: clear stale routingInfo on restart to prevent slow/unstable connections
fix: clear stale routingInfo on restart to prevent slow/unstable connections
2026-02-25 01:03:05 -03:00
github-actions[bot] 75efe2bfbc chore: update proto/version to v2.3000.1034008163 (#218)
Co-authored-by: rsalcara <rsalcara@users.noreply.github.com>
2026-02-25 00:47:42 -03:00
Renato Alcara 12ea77f99f perf(inbound-latency): fix 35-60 s message delivery delay by tightening buffer timeouts
perf(inbound-latency): fix 35-60 s message delivery delay by tightening buffer timeouts
2026-02-25 00:16:22 -03:00
Renato Alcara f906eca124 perf: eliminates a delay in message delivery between phone→app + cache device-list
perf: eliminates a delay in message delivery between phone→app + cache device-list
2026-02-24 07:40:18 -03:00
Renato Alcara d34d3d8791 chore: update WhatsApp Web version to v2.3000.1033950307 (#215)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-24 06:16:12 -03:00
github-actions[bot] b153b1b649 chore: update proto/version to v2.3000.1033927531 (#214)
Co-authored-by: rsalcara <rsalcara@users.noreply.github.com>
2026-02-24 00:47:46 -03:00
Renato Alcara a9753fde6b fix(app-state) - missing key Blocked state, history sync status & 120s timeout
fix(app-state) - missing key Blocked state, history sync status & 120s timeout
2026-02-24 00:05:29 -03:00
Renato Alcara a2382e6fb4 test: add test suites + fix getErrorCodeFromStreamError
test: add test suites + fix getErrorCodeFromStreamError
2026-02-23 23:12:44 -03:00
Renato Alcara c63c7a815f fix: apply 3 surgical gaps from upstream
fix: apply 3 surgical gaps from upstream
2026-02-23 12:13:41 -03:00
Renato Alcara 1112110556 chore: update WhatsApp Web version to v2.3000.1033870439 (#210)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-23 06:16:40 -03:00
github-actions[bot] 4474304b84 chore: update proto/version to v2.3000.1033866714 (#209)
Co-authored-by: rsalcara <rsalcara@users.noreply.github.com>
2026-02-23 00:49:36 -03:00
Renato Alcara 54b399dc2e feat(app-state): App State Sync Resilience (#208)
feat(app-state): App State Sync Resilience (#208)
2026-02-22 21:54:37 -03:00
Renato Alcara 43f6f131cc chore: update WhatsApp Web version to v2.3000.1033852585 (#207)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-22 06:06:16 -03:00
github-actions[bot] aec431bd30 chore: update proto/version to v2.3000.1033849325 (#206)
Co-authored-by: rsalcara <rsalcara@users.noreply.github.com>
2026-02-22 00:46:55 -03:00
Renato Alcara afd5ba027b chore: update WhatsApp Web version to v2.3000.1033835506 (#205)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-21 06:06:18 -03:00
Renato Alcara 89fd500f86 refactor: clean interactive message logs
refactor: clean interactive message logs
2026-02-21 02:06:36 -03:00
github-actions[bot] 16a0d5b163 chore: update proto/version to v2.3000.1033815006 (#203)
Co-authored-by: rsalcara <rsalcara@users.noreply.github.com>
2026-02-21 00:43:23 -03:00
Renato Alcara efae3b751d fix(carousel): fix carousel rendering on Android, iOS and Web
fix(carousel): fix carousel rendering on Android, iOS and Web
2026-02-21 00:36:13 -03:00
Renato Alcara 251cfa25ec fix(tctoken): fix 3 bugs found during code review
fix(tctoken): fix 3 bugs found during code review
2026-02-20 22:27:16 -03:00
Renato Alcara eaade80796 chore: update WhatsApp Web version to v2.3000.1033770598 (#200)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-20 06:12:19 -03:00