#13789: [Feature] Support reading WhatsApp poll vote results
docs
channel: whatsapp-web
stale
Cluster:
Telegram Poll Action Enhancements
Closes #12197
## Summary
Agents can now receive WhatsApp poll votes as messages. When a user votes on a poll sent by the agent, a `[Poll Vote]` message is delivered with the voter and their selections.
## Changes
- `src/web/inbound/poll-store.ts` (new): In-memory store for tracking sent polls
- `src/web/inbound/send-api.ts`: Add `onPollSent` callback
- `src/web/inbound/monitor.ts`: Add `messages.update` handler for poll votes
## How it works
1. When agent sends a poll via `sendPoll()`, it's stored in PollStore
2. When user votes, Baileys emits `messages.update` with encrypted vote data
3. Handler decodes votes using `getAggregateVotesInPollMessage` + stored poll options
4. Vote is formatted as `[Poll Vote] +1234 voted 'Option A' in "Question?"`
5. Message goes through existing debouncer to agent
## Test Plan
- [x] Manual: Sent poll → voted → received [Poll Vote] message
- [x] Multi-select poll consolidates options
- [x] `pnpm build` passes
- [x] Lint passes on modified files
## AI Disclosure
Built with Claude. Code reviewed and understood.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
adds WhatsApp poll vote tracking by storing sent polls and listening for vote update events
- new `PollStore` tracks polls sent via `sendPoll()` with 7-day TTL and cleanup at 100 polls
- `messages.update` handler decodes encrypted votes using Baileys' `getAggregateVotesInPollMessage`
- vote notifications formatted as `[Poll Vote] +1234 voted 'Option A' in "Question?"` and routed through existing debouncer
**Critical issue:** duplicate messages will be sent because `getAggregateVotesInPollMessage` returns cumulative votes (all voters), not just new votes. when a second user votes, the handler sends messages for both voters again. needs vote tracking similar to MS Teams implementation (`extensions/msteams/src/polls-store-memory.ts:19-28`)
<h3>Confidence Score: 1/5</h3>
- contains a critical logic bug that will cause duplicate poll vote messages in production
- the duplicate vote message issue is a fundamental logic error in how `messages.update` events are processed - `getAggregateVotesInPollMessage` returns cumulative results but the handler treats them as new votes, causing exponential message duplication as more users vote
- pay close attention to `src/web/inbound/monitor.ts` - the `handleMessagesUpdate` function needs vote deduplication logic
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#17357: feat(telegram): implement telegram poll action,persistent answer ro...
by akyourowngames · 2026-02-15
75.9%
#17441: feat(telegram): add poll action support
by iacosta3994 · 2026-02-15
73.6%
#17326: fix(whatsapp): group composing indicator, echo prevention, and pres...
by globalcaos · 2026-02-15
72.5%
#17894: fix(telegram): add missing poll action gate with input validation
by PlayerGhost · 2026-02-16
71.6%
#20511: fix: register poll action gate for Telegram adapter (#17528)
by echoVic · 2026-02-19
70.6%
#22690: fix: wire up Telegram poll action in provider dispatch
by sleitor · 2026-02-21
70.5%
#20399: feat(whatsapp): surface inbound reaction events to agent session
by andrewchen · 2026-02-18
70.3%
#17723: Telegram actions: let poll fall back to core sender
by clzoc · 2026-02-16
69.8%
#22489: fix(telegram): wire up poll action in dispatch
by pierreeurope · 2026-02-21
69.6%
#8224: feat(whatsapp): extract @mentions into dedicated module
by zurizuriaria · 2026-02-03
68.7%