From 8349d56f3218a5783e7587ae65c9523d094e63dc Mon Sep 17 00:00:00 2001 From: Caio <117518+caiosba@users.noreply.github.com> Date: Sat, 8 Jun 2024 01:27:23 -0300 Subject: [PATCH] Ticket CV2-4559: Log Facebook Messenger request information only when the output is not the expected one --- app/controllers/api/v1/admin_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/admin_controller.rb b/app/controllers/api/v1/admin_controller.rb index b3488122c0..1f998c4190 100644 --- a/app/controllers/api/v1/admin_controller.rb +++ b/app/controllers/api/v1/admin_controller.rb @@ -80,9 +80,9 @@ def save_facebook_credentials_for_smooch_bot(platform) # "platform" is either "i limit: 100, } response = Net::HTTP.get_response(URI("https://graph.facebook.com/me/accounts?#{q_params.to_query}")) - Rails.logger.info("[Facebook Messenger Integration] API scoped token: #{auth['token']} API response: #{response.body}") pages = JSON.parse(response.body)['data'] if pages.size != 1 + Rails.logger.info("[Facebook Messenger Integration] API scoped token: #{auth['token']} API response: #{response.body}") CheckSentry.notify(StandardError.new('Unexpected list of Facebook pages returned for tipline Messenger integration'), team_bot_installation_id: tbi.id, response: response.body) @message = I18n.t(:must_select_exactly_one_facebook_page) status = 400