fix: fix CI failures from presence subscribe changes

- Use optional chaining on presenceSubscribe call in setActiveChat to
  handle missing mock in tests
- Update setup_channel_provider spec stubs to include autoPresenceSubscribe

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gabrieljablonski 2026-04-13 12:14:11 -03:00
parent 11e9932e9b
commit 104a05a511
2 changed files with 11 additions and 6 deletions

View File

@ -204,7 +204,7 @@ const actions = {
// Ignore error
}
}
ConversationApi.presenceSubscribe(data.id).catch(() => {});
ConversationApi.presenceSubscribe(data.id)?.catch(() => {});
},
assignAgent: async ({ dispatch }, { conversationId, agentId }) => {

View File

@ -101,7 +101,8 @@ describe Whatsapp::Providers::WhatsappBaileysService do
webhookUrl: whatsapp_channel.inbox.callback_webhook_url,
webhookVerifyToken: whatsapp_channel.provider_config['webhook_verify_token'],
includeMedia: false,
groupsEnabled: described_class.groups_enabled?
groupsEnabled: described_class.groups_enabled?,
autoPresenceSubscribe: whatsapp_channel.provider_config['presence_subscribe'] || false
}.to_json
)
.to_return(status: 200)
@ -122,7 +123,8 @@ describe Whatsapp::Providers::WhatsappBaileysService do
webhookUrl: whatsapp_channel.inbox.callback_webhook_url,
webhookVerifyToken: whatsapp_channel.provider_config['webhook_verify_token'],
includeMedia: false,
groupsEnabled: described_class.groups_enabled?
groupsEnabled: described_class.groups_enabled?,
autoPresenceSubscribe: whatsapp_channel.provider_config['presence_subscribe'] || false
}.to_json
)
.to_return(
@ -1378,7 +1380,8 @@ describe Whatsapp::Providers::WhatsappBaileysService do
webhookUrl: whatsapp_channel.inbox.callback_webhook_url,
webhookVerifyToken: whatsapp_channel.provider_config['webhook_verify_token'],
includeMedia: false,
groupsEnabled: described_class.groups_enabled?
groupsEnabled: described_class.groups_enabled?,
autoPresenceSubscribe: whatsapp_channel.provider_config['presence_subscribe'] || false
}.to_json
)
.to_return(status: 200)
@ -1397,7 +1400,8 @@ describe Whatsapp::Providers::WhatsappBaileysService do
webhookUrl: whatsapp_channel.inbox.callback_webhook_url,
webhookVerifyToken: whatsapp_channel.provider_config['webhook_verify_token'],
includeMedia: false,
groupsEnabled: described_class.groups_enabled?
groupsEnabled: described_class.groups_enabled?,
autoPresenceSubscribe: whatsapp_channel.provider_config['presence_subscribe'] || false
}.to_json
)
.to_return(status: 200)
@ -1416,7 +1420,8 @@ describe Whatsapp::Providers::WhatsappBaileysService do
webhookUrl: whatsapp_channel.inbox.callback_webhook_url,
webhookVerifyToken: whatsapp_channel.provider_config['webhook_verify_token'],
includeMedia: false,
groupsEnabled: described_class.groups_enabled?
groupsEnabled: described_class.groups_enabled?,
autoPresenceSubscribe: whatsapp_channel.provider_config['presence_subscribe'] || false
}.to_json
)
.to_return(status: 400, body: 'reconnection failed')