Skip to content

Follow-up: Add logging to custom email address for Service Desk feature

The following discussion from !123681 (merged) should be addressed:

  • @splattael started a discussion: (+3 comments)

    Suggestion It seems we are discarding the service response. Thoughts on logging a message in case of an error? 🤔

    I also wonder if we could provide a reason for every ServiceResponse error and use this reason to decide whether we've handled email verification or not.

    Something like:

            def handled_custom_email_address_verification?
              response = ::ServiceDesk::CustomEmailVerifications::UpdateService.new(
                project: project,
                current_user: nil,
                params: {
                  mail: mail
                }
              ).execute
    
              return false if response.reason == :not_a_verification_subaddress
    
              if response.error?
                # Log error
              end
    
              true

    WDYT?

I basically wanted to add a round of logs before we release the feature.