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
4 changes: 0 additions & 4 deletions app/controllers/concerns/idv/phone_otp_sendable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ module Idv
module PhoneOtpSendable
extend ActiveSupport::Concern

included do
before_action :handle_locked_out_user
end

def send_phone_confirmation_otp
send_phone_confirmation_otp_service.call
end
Expand Down
7 changes: 6 additions & 1 deletion spec/features/idv/doc_auth/verify_info_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,15 @@
visit idv_verify_info_url
expect(page).to have_current_path(idv_session_errors_failure_path)

# Manual expiration is needed because Redis timestamp doesn't always match ruby timestamp
RateLimiter.new(user: user, rate_limit_type: :idv_resolution).reset!
travel_to(IdentityConfig.store.idv_attempt_window_in_hours.hours.from_now + 1) do
sign_in_and_2fa_user(user)
complete_doc_auth_steps_before_verify_step
complete_verify_step

expect(page).to have_current_path(idv_phone_path)
expect(RateLimiter.new(user: user, rate_limit_type: :idv_resolution)).to be_limited
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused why we expected it to be limited, if it's outside of the window, it should have been not limited right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. As best we can figure, this has been wrong for a bit; the other changes made the incorrect test usually pass. This started as a flaky-spec (this one) investigation, and it turned out that the occasional failure was the proper behavior. The problem was confined to the spec, and the duplicate calls to the before action were masking it.

expect(RateLimiter.new(user: user, rate_limit_type: :idv_resolution)).to_not be_limited
end
end

Expand Down Expand Up @@ -232,12 +234,15 @@
visit idv_verify_info_url
expect(page).to have_current_path(idv_session_errors_ssn_failure_path)

# Manual expiration is needed because Redis timestamp doesn't always match ruby timestamp
RateLimiter.new(user: user, rate_limit_type: :idv_resolution).reset!
travel_to(IdentityConfig.store.idv_attempt_window_in_hours.hours.from_now + 1) do
sign_in_and_2fa_user(user)
complete_doc_auth_steps_before_verify_step
complete_verify_step

expect(page).to have_current_path(idv_phone_path)
expect(RateLimiter.new(user: user, rate_limit_type: :idv_resolution)).to_not be_limited
end
end

Expand Down