From 412b72db7c629d1eb3ca431314ad34d9b0552091 Mon Sep 17 00:00:00 2001 From: Alexander Udovichenko Date: Fri, 13 Mar 2026 12:30:17 +0300 Subject: [PATCH] fix: Delete double hmac check (#12464) ## Description When hmac identity check is enabled according to [this](https://www.chatwoot.com/hc/user-guide/articles/1677587479-how-to-enable-identity-validation-in-chatwoot) I found out, that it checked twice. If `should_verify_hmac? -> true` then hmac checked in `before_action` and we don't need to do it again later. This perfomance related and PR fixes this. --- app/controllers/api/v1/widget/contacts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/widget/contacts_controller.rb b/app/controllers/api/v1/widget/contacts_controller.rb index 5138fe675..6c595ab59 100644 --- a/app/controllers/api/v1/widget/contacts_controller.rb +++ b/app/controllers/api/v1/widget/contacts_controller.rb @@ -19,7 +19,7 @@ class Api::V1::Widget::ContactsController < Api::V1::Widget::BaseController contact = @contact end - @contact_inbox.update(hmac_verified: true) if should_verify_hmac? && valid_hmac? + @contact_inbox.update(hmac_verified: true) if should_verify_hmac? identify_contact(contact) end