Skip to content

fix: announce pushname via available presence after connect#252

Merged
steipete merged 2 commits into
openclaw:mainfrom
ceifa:fix/initial-presence-pushname
May 20, 2026
Merged

fix: announce pushname via available presence after connect#252
steipete merged 2 commits into
openclaw:mainfrom
ceifa:fix/initial-presence-pushname

Conversation

@ceifa
Copy link
Copy Markdown
Contributor

@ceifa ceifa commented May 20, 2026

Summary

  • Send Presence: available after every successful authenticated connect so the server records the linked-device pushname.
  • Without it, downstream recipients receive notify="" / "-", and Cloud API verified-business webhook pipelines silently drop those messages at the gateway — the send still receives a <biz/> delivery ack so the failure is invisible from the sender side.

Why

whatsmeow's own SendPresence docs already warn:

You should call this at least once after connecting so that the server has your pushname. Otherwise, other users will see "-" as the name.

WhatsApp Business app contacts tolerate the missing pushname, which is why this has not surfaced before. Meta Cloud API (verified_level="high") bots do not: their webhook never fires for senders without a valid pushname, even though the server gateway acknowledges delivery.

Notes

  • Best-effort: any error from SendPresence is logged to stderr and ignored so it never blocks the connect.
  • Guarded by len(cli.Store.PushName) > 0 because SendPresence returns ErrNoPushName otherwise (and pre-auth flows reach this branch with an empty store).
  • No new tests: the call lives on a real websocket-connected client and the existing internal/wa suite doesn't have a fake whatsmeow client to assert against. Verified manually against a Cloud API business chat that was silently dropping wacli sends — the bot started replying within seconds once this was in place.

Human note

Same as #240, I don't know golang, I asked my claw to try fix it and it did, then I asked to open a PR and it probably has slop. Feel free to close but you can use it as a reference to actually fix the problem.

whatsmeow's SendPresence docs warn that the server only learns the
linked-device pushname once an "available" presence is sent. Without
that call, downstream recipients receive notify="" / "-" for messages
sent through wacli. WhatsApp Business app contacts tolerate this, but
Cloud API verified-business webhook pipelines silently drop messages
from senders with an empty pushname — the send still receives a <biz/>
delivery ack at the gateway, so the failure is invisible to the sender.

Send the presence once after every authenticated connect (when a
pushname is available). Failure is logged to stderr and ignored so it
never blocks the connect.
@ceifa ceifa force-pushed the fix/initial-presence-pushname branch from 5a1dde1 to 04eb618 Compare May 20, 2026 12:43
@steipete steipete merged commit fc954c1 into openclaw:main May 20, 2026
2 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.

2 participants