Repository navigation
Conversation
… notifications Fixes openclaw#30286 Baileys explicitly called `sendPresenceUpdate('available')` in `src/web/inbound/monitor.ts` on connect, overriding `markOnlineOnConnect: false` in `session.ts`. This suppresses all push notifications on the phone for every chat while the gateway is running. Changed to `sendPresenceUpdate('unavailable')` by default. Added optional `channels.whatsapp.announcePresence` config flag (default: `false`) for users who want to opt back into online presence.
Greptile SummaryThis PR fixes a bug where WhatsApp phone notifications were being suppressed while the gateway is running. The root cause was an explicit Key changes:
The implementation is clean, well-documented, and follows the existing codebase patterns. The default behavior now matches other Baileys-based implementations like Beeper. Confidence Score: 5/5
Last reviewed commit: 1275a3f |
|
👍 |
1 similar comment
|
👍 |
|
👍 |
|
@steipete 👋 can I help somehow to get this merged? Thanks! |
|
LGTM 👍 |
|
Thanks for the PR and for working on this — the root cause analysis in #30286 was spot-on and directly informed the fix that landed. We checked the current main branch and implemented a targeted fix via #59410, which gates the connect-time presence on the existing selfChatMode flag: personal-phone setups (selfChatMode: true) now send "unavailable" to preserve phone notifications, while dedicated bot numbers keep "available" so the bot shows as online. This avoids both a new config field and a blanket behavior change for all users. Because #59410 covers this, I'm closing this PR as superseded. Thanks again for the work here @Ecarrion for the detailed issue writeup and Beeper comparison that confirmed the root cause. If you think this closure is mistaken and your PR still fixes something meaningfully different on current main, feel free to reopen or open a new PR with that explanation. |
Summary
Fixes #30286
Baileys explicitly called
sendPresenceUpdate('available')insrc/web/inbound/monitor.tson connect, overridingmarkOnlineOnConnect: falseinsession.ts. This suppresses all push notifications on the phone for every chat while the gateway is running.Root cause: The existing
markOnlineOnConnect: falseinsession.tsis correct, but it was overridden by the explicitsendPresenceUpdate("available")call ininbound/monitor.ts.Changes
src/web/inbound/monitor.ts: use"unavailable"presence by default; read fromoptions.announcePresencesrc/web/auto-reply/monitor.ts: threadannouncePresencethroughsrc/web/accounts.ts: resolveannouncePresence(defaultfalse)src/config/types.whatsapp.ts: addannouncePresencefieldsrc/config/zod-schema.providers-whatsapp.ts: add zod validationsrc/web/monitor-inbox.streams-inbound-messages.test.ts: update assertionssrc/web/monitor-inbox.captures-media-path-image-messages.test.ts: update assertionsConfig
Comparison: Beeper (also Baileys-based) uses the same approach and does not suppress phone notifications.