iachat/spec/services/whatsapp
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
..
baileys_handlers feat(whatsapp): show contact typing and recording indicators via baileys presence (#264) 2026-04-13 11:38:11 -03:00
providers release v4.12.0-fazer-ai.47 (#259) 2026-04-08 20:52:26 -03:00
zapi_handlers fix(whatsapp): resolve phone_number conflict when converting inbox between providers (#252) 2026-04-01 16:51:38 -03:00
channel_creation_service_spec.rb Chore/merge upstream 4.8.0 (#150) 2025-11-19 16:25:58 -03:00
contact_inbox_consolidation_service_spec.rb fix(whatsapp): resolve phone_number conflict when converting inbox between providers (#252) 2026-04-01 16:51:38 -03:00
csat_template_service_spec.rb Merge branch 'main' into chore/merge-upstream-4.12.0 2026-03-19 23:24:55 -03:00
embedded_signup_service_spec.rb feat: Add WhatsApp health monitoring and self-service registration completion (#12556) 2025-10-02 11:25:48 +05:30
facebook_api_client_spec.rb fix: Subscribe app to WABA before overriding webhook callback URL (#13279) 2026-02-02 16:50:35 +05:30
incoming_message_baileys_service_spec.rb feat: group conversations (#228) 2026-03-19 21:56:58 -03:00
incoming_message_service_spec.rb Merge branch 'main' into chore/merge-upstream-4.11.0 2026-02-17 23:05:26 -03:00
incoming_message_whatsapp_cloud_service_spec.rb release v4.12.0-fazer-ai.44 (#253) 2026-04-03 12:03:12 -03:00
incoming_message_zapi_service_spec.rb feat(zapi): handle contact messages and ignore notifications (#124) 2025-10-26 10:48:06 -03:00
message_dedup_lock_spec.rb fix: duplicate message_created webhooks for WhatsApp messages (#13523) 2026-02-17 14:01:10 +05:30
oneoff_campaign_service_spec.rb Merge branch 'main' into chore/merge-upstream-4.5.0 2025-08-20 11:20:31 -03:00
phone_info_service_spec.rb feat: Whatsapp embedded signup (#11612) 2025-07-14 21:37:06 -07:00
populate_template_parameters_service_spec.rb fix: Normalize URLs with spaces in WhatsApp template parameters (#12594) 2025-10-08 15:33:06 +05:30
send_on_whatsapp_service_spec.rb release v4.12.0-fazer-ai.47 (#259) 2026-04-08 20:52:26 -03:00
template_parameter_converter_service_spec.rb fix: Handle nil processed_params for WhatsApp templates without params (#12177) 2025-08-12 22:56:53 +05:30
token_exchange_service_spec.rb feat: Whatsapp embedded signup (#11612) 2025-07-14 21:37:06 -07:00
token_validation_service_spec.rb feat: Whatsapp embedded signup (#11612) 2025-07-14 21:37:06 -07:00
webhook_setup_service_spec.rb fix: Setup webhooks for manual WhatsApp Cloud channel creation (#13278) 2026-01-19 14:12:36 +04:00
webhook_teardown_service_spec.rb feat: add reauth flow for wa embedded signup (#11940) 2025-08-08 01:48:45 +05:30