chore: Apply fixes for items in rubocop_todo [CW-1806] (#8864)

This PR addresses several items listed in our rubocop_todo by implementing the necessary corrections and enhancements. As a result, we are now able to remove the rubocop_todo file entirely, streamlining our codebase and ensuring adherence to our coding standards.

fixes: https://linear.app/chatwoot/issue/CW-1806/chore-rubocop-audit
This commit is contained in:
Sojan Jose
2024-02-07 13:36:04 +04:00
committed by GitHub
parent 3abb887445
commit 7776b74126
21 changed files with 67 additions and 398 deletions

View File

@@ -46,20 +46,20 @@ class Channel::FacebookPage < ApplicationRecord
def subscribe
# ref https://developers.facebook.com/docs/messenger-platform/reference/webhook-events
response = Facebook::Messenger::Subscriptions.subscribe(
Facebook::Messenger::Subscriptions.subscribe(
access_token: page_access_token,
subscribed_fields: %w[
messages message_deliveries message_echoes message_reads standby messaging_handovers
]
)
rescue => e
rescue StandardError => e
Rails.logger.debug { "Rescued: #{e.inspect}" }
true
end
def unsubscribe
Facebook::Messenger::Subscriptions.unsubscribe(access_token: page_access_token)
rescue => e
rescue StandardError => e
Rails.logger.debug { "Rescued: #{e.inspect}" }
true
end
@@ -73,6 +73,7 @@ class Channel::FacebookPage < ApplicationRecord
delete_instagram_story(message) if story_link.blank?
story_link
rescue Koala::Facebook::ClientError => e
Rails.logger.debug { "Instagram Story Expired: #{e.inspect}" }
delete_instagram_story(message)
end