iachat/spec/services
Gabriel Jablonski 11e9932e9b
feat(whatsapp): show contact typing and recording indicators via baileys presence (#264)
* feat(whatsapp): show contact typing and recording indicators via baileys presence

Subscribe to WhatsApp presence updates via the baileys-api provider to
display real-time typing and recording indicators in the dashboard.

- Handle presence.update webhook events (composing, recording, paused,
  available) and broadcast via ActionCable
- Add conversation.recording event to ActionCable, webhook, and channel
  listeners for parity with typing_on/typing_off
- Show "typing..." / "recording..." in green text on the chat list,
  replacing the message preview
- Show "X is typing" / "X is recording audio" in the conversation view
- Add presence_subscribe provider config option (default off) to gate
  all subscription calls to the baileys-api
- Subscribe to presence on conversation open and periodically (1 min)
  for the top 10 chat list conversations
- Consolidate contact LID from presence.update jidAlt payload
- Prevent echo-back of contact typing events to the channel

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address review feedback

- Filter chat list typing indicator to contact-only events
- Add dedupe to presence subscribe bulk calls
- Use strong parameters for conversation_ids
- Remove redundant YAML quotes in swagger webhook enum

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address review feedback

- Extract phone from data[:id] when JID is @s.whatsapp.net (fallback
  when jidAlt is absent)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address review feedback

- Filter recording users in getTypingUsersText to show correct names
- Add 10s timeout to presence_subscribe HTTP request

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: scope typing timer per user instead of per conversation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: make presence subscribe best-effort with rescue per channel

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address review feedback

- Add messagePreviewClass to typing preview for consistent padding
- Fix specs to use WebMock assertions instead of instance spying

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 11:38:11 -03:00
..
account feat: Add automatic favicon fetching for companies (#13013) 2026-03-05 18:51:28 -08:00
audio feat: add audio transcoding support for WhatsApp Cloud API (#220) 2026-02-22 16:21:50 -03:00
auto_assignment perf: add default configs for assignment V2 (#13577) 2026-02-23 15:08:11 +05:30
automation_rules feat: mensagens agendadas (#198) 2026-01-30 22:08:16 -03:00
contacts Merge branch 'chatwoot/develop' into chore/merge-upstream-4.12.0 2026-03-20 00:27:45 -03:00
conversations feat(whatsapp): show contact typing and recording indicators via baileys presence (#264) 2026-04-13 11:38:11 -03:00
crm/leadsquared Merge branch main into chore/merge-upstream 2025-12-20 12:44:31 -03:00
email fix: email delivery in Email::SendOnEmailService (#217) 2026-02-18 16:23:13 -03:00
facebook feat(facebook): use HUMAN_AGENT tag for Messenger replies when human-agent config is enabled (#13690) 2026-03-02 15:32:59 +04:00
google chore: apply Rails/SaveBang cop (#15) 2025-04-03 23:29:24 -03:00
imap feat: Add configurable interval for IMAP sync (#9302) 2024-04-25 18:58:20 -07:00
instagram feat: Handle instagram test service (#11244) 2025-04-11 19:11:29 +05:30
internal feat: add job to remove stale contacts and contact_inboxes (#11186) 2025-03-28 12:18:39 +05:30
internal_chat feat(internal-chat): implement internal chat system for agents (#247) 2026-04-11 13:50:15 -03:00
labels fix: Update associations when a label is updated (#3046) 2021-09-21 10:16:32 +05:30
line Merge branch 'main' into chore/merge-upstream-4.12.0 2026-03-19 23:24:55 -03:00
linear feat: Whatsapp embedded signup (#11612) 2025-07-14 21:37:06 -07:00
liquid feat: Add liquid processing for SMS campaigns (#10981) 2025-06-11 13:16:44 -04:00
llm_formatter Chore/merge upstream 4.8.0 (#150) 2025-11-19 16:25:58 -03:00
macros feat: Add webhook event support for macros (#11235) 2025-04-02 20:26:55 -07:00
mailbox Chore/merge upstream 4.8.0 (#150) 2025-11-19 16:25:58 -03:00
message_templates Merge branch 'chatwoot/develop' into chore/merge-upstream-4.12.0 2026-03-20 00:27:45 -03:00
messages Merge branch 'main' into chore/merge-upstream-4.12.0 2026-03-19 23:24:55 -03:00
mfa feat: MFA (#12290) 2025-09-18 20:19:24 +05:30
microsoft chore: apply Rails/SaveBang cop (#15) 2025-04-03 23:29:24 -03:00
notification chore: Disable email notifications for unconfirmed users (#10964) 2025-02-24 12:14:40 -08:00
reporting_events feat(rollup): add models and write path [1/3] (#13796) 2026-03-19 13:12:36 +05:30
sms Merge branch 'main' into chore/merge-upstream-4.5.0 2025-08-20 11:20:31 -03:00
telegram Merge branch 'main' into chore/merge-upstream-4.12.0 2026-03-19 23:24:55 -03:00
tiktok feat(inbox): Enable conversation continuity for social channels (#11079) 2026-02-25 13:56:51 +04:00
twilio Merge branch 'main' into chore/merge-upstream-4.10 2026-01-16 14:01:53 -03:00
twitter chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
whatsapp feat(whatsapp): show contact typing and recording indicators via baileys presence (#264) 2026-04-13 11:38:11 -03:00
widget Chore/merge upstream 4.8.0 (#150) 2025-11-19 16:25:58 -03:00
account_deletion_service_spec.rb fix(account-deletion): normalize deleted email suffix and handle collisions safely (#13472) 2026-02-07 17:29:27 -08:00
action_service_spec.rb Merge branch 'chatwoot/develop' into chore/merge-upstream-4.12.0 2026-03-20 00:27:45 -03:00
base_token_service_spec.rb feat: MFA (#12290) 2025-09-18 20:19:24 +05:30
csat_survey_service_spec.rb feat: Implement existing template linking for CSAT surveys (#218) 2026-02-18 18:00:29 -03:00
csat_template_utility_analysis_service_spec.rb feat(csat): Add WhatsApp utility template analyzer with rewrite guidance (#13575) 2026-02-24 15:11:04 +04:00
search_service_spec.rb Merge branch 'main' into chore/merge-upstream-4.10 2026-01-16 14:01:53 -03:00