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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user