Skip to content

fix: stop suppressing phone notifications on connect#91

Merged
gavrielc merged 1 commit into
nanocoai:mainfrom
jonazri:fix/notification-suppression
Apr 14, 2026
Merged

fix: stop suppressing phone notifications on connect#91
gavrielc merged 1 commit into
nanocoai:mainfrom
jonazri:fix/notification-suppression

Conversation

@jonazri

@jonazri jonazri commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Set markOnlineOnConnect: false in makeWASocket() so Baileys sends unavailable presence on connect instead of available
  • Remove the explicit sendPresenceUpdate('available') call that contradicted this setting
  • Add unit test verifying markOnlineOnConnect: false is passed

Closes #90

Test plan

  • npm run build — clean compile
  • npm test — 288/288 pass
  • Restart NanoClaw, confirm connection succeeds
  • Regular WhatsApp notifications arrive on phone
  • No "Finished syncing" notification after reconnect
  • Typing indicators work in DMs and groups

🤖 Generated with Claude Code

…n connect

Set markOnlineOnConnect: false so Baileys sends 'unavailable' presence
instead of 'available'. This prevents WhatsApp from treating the client
as an active desktop session, which was suppressing all phone push
notifications and triggering repeated "Finished syncing" notifications
on every reconnect.

Remove the explicit sendPresenceUpdate('available') call that
contradicted this setting.

Closes #90

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 5, 2026 23:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the WhatsApp (Baileys) connection behavior to avoid advertising a globally “available” presence on connect, which can cause WhatsApp to treat the client as an active companion session and suppress phone push notifications (per #90).

Changes:

  • Pass markOnlineOnConnect: false into makeWASocket() options.
  • Remove the explicit sendPresenceUpdate('available') call on connection open.
  • Add a unit test asserting markOnlineOnConnect: false is provided to Baileys.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/channels/whatsapp.ts Sets markOnlineOnConnect: false and removes the conflicting “available” presence update on connect.
src/channels/whatsapp.test.ts Adds a unit test verifying the Baileys socket is created with markOnlineOnConnect: false.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gavrielc gavrielc merged commit 9777d29 into nanocoai:main Apr 14, 2026
7 of 9 checks passed
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.

WhatsApp suppresses all phone notifications while NanoClaw is running

3 participants