Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions app/controllers/concerns/idv/verify_info_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ def process_async_state(current_async_state)

log_idv_verification_submitted_event(
success: false,
failure_reason: { idv_verification: [:timeout] },
)
end
end
Expand Down Expand Up @@ -204,7 +203,6 @@ def async_state_done(current_async_state)
)
log_idv_verification_submitted_event(
success: form_response.success?,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(form_response),
)

form_response.extra[:ssn_is_unique] = DuplicateSsnFinder.new(
Expand Down Expand Up @@ -297,7 +295,7 @@ def idv_result_to_form_response(
)
end

def log_idv_verification_submitted_event(success: false, failure_reason: nil)
def log_idv_verification_submitted_event(success: false)
pii_from_doc = pii || {}
irs_attempts_api_tracker.idv_verification_submitted(
success: success,
Expand All @@ -310,7 +308,6 @@ def log_idv_verification_submitted_event(success: false, failure_reason: nil)
date_of_birth: pii_from_doc[:dob],
address: pii_from_doc[:address1],
ssn: idv_session.ssn,
failure_reason: failure_reason,
)
end

Expand Down
2 changes: 0 additions & 2 deletions app/controllers/concerns/unconfirmed_user_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def track_user_already_confirmed_event
irs_attempts_api_tracker.user_registration_email_confirmation(
email: @email_address.email,
success: false,
failure_reason: { email: [:already_confirmed] },
)
end

Expand All @@ -39,7 +38,6 @@ def stop_if_invalid_token
irs_attempts_api_tracker.user_registration_email_confirmation(
email: @email_address&.email,
success: false,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)
process_unsuccessful_confirmation
end
Expand Down
1 change: 0 additions & 1 deletion app/controllers/idv/by_mail/enter_code_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def create
analytics.idv_verify_by_mail_enter_code_submitted(**result.to_h)
irs_attempts_api_tracker.idv_gpo_verification_submitted(
success: result.success?,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)

if !result.success?
Expand Down
5 changes: 1 addition & 4 deletions app/controllers/idv/hybrid_handoff_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,15 @@ def handle_phone_submission
telephony_result = send_link
telephony_form_response = build_telephony_form_response(telephony_result)

failure_reason = nil
if !telephony_result.success?
failure_reason = { telephony: [telephony_result.error.class.name.demodulize] }
failure(telephony_form_response.errors[:message])
end
irs_attempts_api_tracker.idv_phone_upload_link_sent(
success: telephony_result.success?,
phone_number: formatted_destination_phone,
failure_reason: failure_reason,
)

if !failure_reason
if telephony_result.success?
redirect_to idv_link_sent_url
else
redirect_to idv_hybrid_handoff_url
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/idv/otp_verification_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,9 @@ def update
result = phone_confirmation_otp_verification_form.submit(code: params[:code])
analytics.idv_phone_confirmation_otp_submitted(**result.to_h)

parsed_failure_reason =
(result.extra.slice(:code_expired) if result.extra[:code_expired]) ||
(result.extra.slice(:code_matches) if !result.success? && !result.extra[:code_matches]) ||
{}
irs_attempts_api_tracker.idv_phone_otp_submitted(
success: result.success?,
phone_number: idv_session.user_phone_confirmation_session.phone,
failure_reason: parsed_failure_reason,
)

if result.success?
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/idv/phone_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def create
irs_attempts_api_tracker.idv_phone_submitted(
success: result.success?,
phone_number: step_params[:phone],
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)
if result.success?
submit_proofing_attempt
Expand Down Expand Up @@ -96,7 +95,6 @@ def send_phone_confirmation_otp_and_handle_result
phone_number: @idv_phone,
success: result.success?,
otp_delivery_method: idv_session.previous_phone_step_params[:otp_delivery_preference],
failure_reason: result.success? ? {} : otp_sent_tracker_error(result),
)
if result.success?
redirect_to idv_otp_verification_url
Expand Down
1 change: 0 additions & 1 deletion app/controllers/sign_up/email_confirmations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def process_successful_confirmation
irs_attempts_api_tracker.user_registration_email_confirmation(
email: @email_address&.email,
success: true,
failure_reason: nil,
)
redirect_to sign_up_enter_password_url(confirmation_token: @confirmation_token)
end
Expand Down
3 changes: 0 additions & 3 deletions app/controllers/sign_up/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,9 @@ def render_page
end

def track_analytics(result)
failure_reason = irs_attempts_api_tracker.parse_failure_reason(result)

analytics.password_creation(**result.to_h)
irs_attempts_api_tracker.user_registration_password_submitted(
success: result.success?,
failure_reason: failure_reason,
)
end

Expand Down
1 change: 0 additions & 1 deletion app/controllers/sign_up/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def create
irs_attempts_api_tracker.user_registration_email_submitted(
email: permitted_params[:email],
success: result.success?,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)

if result.success?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def process_token
irs_attempts_api_tracker.mfa_login_piv_cac(
success: result.success?,
subject_dn: piv_cac_verification_form.x509_dn,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)
if result.success?
handle_valid_piv_cac
Expand Down
1 change: 0 additions & 1 deletion app/controllers/users/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def update
analytics.password_changed(**result.to_h)
irs_attempts_api_tracker.logged_in_password_change(
success: result.success?,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)

if result.success?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def process_piv_cac_setup
irs_attempts_api_tracker.mfa_enroll_piv_cac(
success: result.success?,
subject_dn: user_piv_cac_form.x509_dn,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)
if result.success?
process_valid_submission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def process_piv_cac_setup
irs_attempts_api_tracker.mfa_enroll_piv_cac(
success: result.success?,
subject_dn: user_piv_cac_form.x509_dn,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)
if result.success?
process_valid_submission
Expand Down
3 changes: 0 additions & 3 deletions app/controllers/users/reset_passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def edit
analytics.password_reset_token(**result.to_h)
irs_attempts_api_tracker.forgot_password_email_confirmed(
success: result.success?,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)
if result.success?
@reset_password_form = ResetPasswordForm.new(build_user)
Expand All @@ -52,7 +51,6 @@ def update
analytics.password_reset_password(**result.to_h)
irs_attempts_api_tracker.forgot_password_new_password_submitted(
success: result.success?,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)

if result.success?
Expand Down Expand Up @@ -117,7 +115,6 @@ def create_account_if_email_not_found
irs_attempts_api_tracker.user_registration_email_submitted(
email: email,
success: result.success?,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)
create_user_event(:account_created, user)
end
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/users/two_factor_authentication_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,13 @@ def track_events(otp_delivery_preference:, otp_delivery_selection_result:)
reauthentication: true,
phone_number: parsed_phone.e164,
otp_delivery_method: otp_delivery_preference,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(@telephony_result),
)
elsif UserSessionContext.authentication_or_reauthentication_context?(context)
irs_attempts_api_tracker.mfa_login_phone_otp_sent(
success: @telephony_result.success?,
reauthentication: false,
phone_number: parsed_phone.e164,
otp_delivery_method: otp_delivery_preference,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(@telephony_result),
)
elsif UserSessionContext.confirmation_context?(context)
irs_attempts_api_tracker.mfa_enroll_phone_otp_sent(
Expand Down
1 change: 0 additions & 1 deletion app/controllers/users/verify_personal_key_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def create
)
irs_attempts_api_tracker.personal_key_reactivation_submitted(
success: result.success?,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)
if result.success?
handle_success(decrypted_pii: personal_key_form.decrypted_pii)
Expand Down
1 change: 0 additions & 1 deletion app/forms/idv/api_image_upload_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ def track_event(response)
last_name: pii_from_doc[:last_name],
date_of_birth: pii_from_doc[:dob],
address: pii_from_doc[:address1],
failure_reason: response.errors&.except(:hints)&.presence,
)
end

Expand Down
5 changes: 0 additions & 5 deletions app/services/account_reset/track_irs_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module AccountReset::TrackIrsEvent
def track_irs_event
irs_attempts_api_tracker.account_reset_account_deleted(
success: success,
failure_reason: event_failure_reason.presence,
)
end

Expand All @@ -20,8 +19,4 @@ def irs_attempts_api_tracker
def cookies
request.cookie_jar
end

def event_failure_reason
errors.is_a?(ActiveModel::Errors) ? errors.messages.to_hash : errors
end
end
7 changes: 0 additions & 7 deletions app/services/idv/steps/threat_metrix_step_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,10 @@ def log_irs_tmx_fraud_check_event(result, user)
user: user,
login_session_id: Digest::SHA1.hexdigest(user.unique_session_id.to_s),
)

if (tmx_summary_reason_code = result.dig(:response_body, :tmx_summary_reason_code))
failure_reason = {
tmx_summary_reason_code: tmx_summary_reason_code,
}
end
end

irs_attempts_api_tracker.idv_tmx_fraud_check(
success: success,
failure_reason: failure_reason,
)
end
end
Expand Down
4 changes: 0 additions & 4 deletions app/services/irs_attempts_api/tracker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ class Tracker

def track_event(event_type, metadata = {})
end

def parse_failure_reason(result)
return result.to_h[:error_details]&.transform_values(&:keys) || result.errors.presence
end
end
end
Loading