Skip to content

test: add WhatsApp connector tests (38 tests)#182

Merged
gavrielc merged 1 commit intomainfrom
whatsapp-connector-tests
Feb 12, 2026
Merged

test: add WhatsApp connector tests (38 tests)#182
gavrielc merged 1 commit intomainfrom
whatsapp-connector-tests

Conversation

@TomGranot
Copy link
Copy Markdown
Collaborator

Summary

  • Adds 38 comprehensive tests for the WhatsApp connector (src/channels/whatsapp.ts)
  • Previously the only untested module — all other core modules (db, formatting, ipc-auth, container-runner, routing, group-queue) already had test coverage
  • Based on a deep-dive audit of Baileys v7.0.0-rc.9 internals

Test Coverage

Area Tests What's covered
Connection lifecycle 4 connect/open, LID mapping on connect, queue flush on reconnect, disconnect
Authentication 1 QR code triggers process.exit(1)
Reconnection 3 non-loggedOut reconnects, loggedOut exits, 5s retry on failure
Message handling 9 registered group delivery, unregistered metadata-only, status@broadcast filtering, no-content skip, extendedTextMessage, imageMessage caption, videoMessage caption, voice note (empty content), pushName fallback
LID↔JID translation 3 known LID translation, non-LID passthrough, unknown LID passthrough
Outgoing queue 4 direct send, queue when disconnected, queue on failure, ordered flush
Group metadata sync 5 first connection sync, recent sync skip, force sync, failure handling, no-subject skip
JID ownership 4 @g.us, @s.whatsapp.net, Telegram rejection, unknown rejection
Typing indicators 3 composing, paused, failure handling
Channel properties 2 name, prefixAssistantName

Audit findings (not fixed in this PR, just documented via tests)

  • No exponential backoff on reconnect (single 5s retry)
  • Voice notes, documents, stickers, locations, reactions not extracted as content
  • LID translation only for self-chat (not other participants)
  • Boolean connection state (no state machine)
  • No rate limiting on outbound messages

Test plan

  • All 139 tests pass (101 existing + 38 new)
  • npm test clean

🤖 Generated with Claude Code

38 tests covering connection lifecycle, authentication, reconnection,
message handling (text, image, video, voice, extended text), LID↔JID
translation, outgoing message queue, group metadata sync, JID ownership,
and typing indicators. Based on deep-dive audit of Baileys v7 internals.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@TomGranot TomGranot requested a review from gavrielc as a code owner February 12, 2026 15:13
Copy link
Copy Markdown
Collaborator

@gavrielc gavrielc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!!

@gavrielc gavrielc merged commit 6863c0b into main Feb 12, 2026
2 checks passed
@TomGranot TomGranot mentioned this pull request Feb 12, 2026
1 task
joyshmitz pushed a commit to joyshmitz/nanoclaw that referenced this pull request Feb 12, 2026
38 tests covering connection lifecycle, authentication, reconnection,
message handling (text, image, video, voice, extended text), LID↔JID
translation, outgoing message queue, group metadata sync, JID ownership,
and typing indicators. Based on deep-dive audit of Baileys v7 internals.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@TomGranot TomGranot deleted the whatsapp-connector-tests branch February 12, 2026 20:34
timmoser pushed a commit to timmoser/Shelby that referenced this pull request Feb 14, 2026
38 tests covering connection lifecycle, authentication, reconnection,
message handling (text, image, video, voice, extended text), LID↔JID
translation, outgoing message queue, group metadata sync, JID ownership,
and typing indicators. Based on deep-dive audit of Baileys v7 internals.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
tunmaker pushed a commit to tunmaker/nanoclaw that referenced this pull request Feb 24, 2026
38 tests covering connection lifecycle, authentication, reconnection,
message handling (text, image, video, voice, extended text), LID↔JID
translation, outgoing message queue, group metadata sync, JID ownership,
and typing indicators. Based on deep-dive audit of Baileys v7 internals.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
bebekim pushed a commit to bebekim/goodclaw that referenced this pull request Mar 14, 2026
38 tests covering connection lifecycle, authentication, reconnection,
message handling (text, image, video, voice, extended text), LID↔JID
translation, outgoing message queue, group metadata sync, JID ownership,
and typing indicators. Based on deep-dive audit of Baileys v7 internals.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
squarewings pushed a commit to squarewings/nanoclaw that referenced this pull request Mar 15, 2026
38 tests covering connection lifecycle, authentication, reconnection,
message handling (text, image, video, voice, extended text), LID↔JID
translation, outgoing message queue, group metadata sync, JID ownership,
and typing indicators. Based on deep-dive audit of Baileys v7 internals.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
onlyforart referenced this pull request in onlyforart/nanoclaw Mar 17, 2026
38 tests covering connection lifecycle, authentication, reconnection,
message handling (text, image, video, voice, extended text), LID↔JID
translation, outgoing message queue, group metadata sync, JID ownership,
and typing indicators. Based on deep-dive audit of Baileys v7 internals.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
kenansun-dev-bot bot pushed a commit to kenansun-dev/nanoclaw-github-copilot that referenced this pull request Apr 12, 2026
…che (qwibitai#182)

1. Docker rebuild check: any agent with mode=sandbox triggers rebuild
   (not just defaults.mode). Same pattern as qwibitai#180.
2. Clear agent-runner-src cache after update — forces fresh copy on
   next container spawn, preventing stale MCP tools.

Co-authored-by: Kenan Rpi5 Claw <rpi5-claw@nanoclaw.dev>
dm-j pushed a commit to dm-j/nanoclaw that referenced this pull request Apr 13, 2026
38 tests covering connection lifecycle, authentication, reconnection,
message handling (text, image, video, voice, extended text), LID↔JID
translation, outgoing message queue, group metadata sync, JID ownership,
and typing indicators. Based on deep-dive audit of Baileys v7 internals.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants