Skip to content

Commit

Permalink
fix: change email conversation not found exception to log (#8785)
Browse files Browse the repository at this point in the history
* fix: change email conversation not found exception to log

* chore: refactor reply_mailbox methods

---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
  • Loading branch information
vishnu-narayanan and sojan-official committed Jan 25, 2024
1 parent 5918412 commit 3c952e6
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions app/mailboxes/reply_mailbox.rb
Expand Up @@ -6,11 +6,12 @@ class ReplyMailbox < ApplicationMailbox
EMAIL_PART_PATTERN = /^reply\+([0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12})$/i

before_processing :conversation_uuid_from_to_address,
:find_relative_conversation,
:verify_decoded_params,
:decorate_mail
:find_relative_conversation

def process
return if @conversation.blank?

decorate_mail
create_message
add_attachments_to_message
end
Expand Down Expand Up @@ -78,12 +79,8 @@ def find_by_in_reply_to_addresses(match_result, in_reply_to_addresses)
find_conversation_by_message_id(in_reply_to_addresses) if @conversation.blank?
end

def verify_decoded_params
raise 'Conversation uuid not found' if conversation_uuid.nil?
end

def validate_resource(resource)
raise "Email conversation with uuid: #{conversation_uuid} not found" if resource.nil?
Rails.logger.error "[App::Mailboxes::ReplyMailbox] Email conversation with uuid: #{conversation_uuid} not found" if resource.nil?

resource
end
Expand Down

0 comments on commit 3c952e6

Please sign in to comment.