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
1 change: 1 addition & 0 deletions app/controllers/idv_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def index
elsif active_profile? && !strict_ial2_upgrade_required?
redirect_to idv_activated_url
elsif idv_attempter_throttled?
irs_attempts_api_tracker.idv_verification_rate_limited
analytics.throttler_rate_limit_triggered(
throttle_type: :idv_resolution,
)
Expand Down
1 change: 1 addition & 0 deletions app/services/idv/steps/verify_base_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def throttle
def idv_failure(result)
throttle.increment! if result.extra.dig(:proofing_results, :exception).blank?
if throttle.throttled?
@flow.irs_attempts_api_tracker.idv_verification_rate_limited
@flow.analytics.throttler_rate_limit_triggered(
throttle_type: :idv_resolution,
step_name: self.class.name,
Expand Down
7 changes: 7 additions & 0 deletions app/services/irs_attempts_api/tracker_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,13 @@ def idv_ssn_submitted(success:, ssn:)
)
end

# Track when idv verification is rate limited during idv flow
def idv_verification_rate_limited
track_event(
:idv_verification_rate_limited,
)
end

# @param [Boolean] success
# @param [String] document_state
# @param [String] document_number
Expand Down
3 changes: 3 additions & 0 deletions spec/controllers/idv_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
end

it 'redirects to failure page if number of attempts has been exceeded' do
stub_attempts_tracker
expect(@irs_attempts_api_tracker).to receive(:track_event).
with(:idv_verification_rate_limited)
user = create(:user)
profile = create(
:profile,
Expand Down
1 change: 1 addition & 0 deletions spec/features/idv/doc_auth/verify_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
end

it 'throttles resolution and continues when it expires' do
expect(fake_attempts_tracker).to receive(:idv_verification_rate_limited)
sign_in_and_2fa_user
complete_doc_auth_steps_before_ssn_step
fill_out_ssn_form_with_ssn_that_fails_resolution
Expand Down