diff --git a/app/controllers/concerns/idv_step_concern.rb b/app/controllers/concerns/idv_step_concern.rb index dab170f9789..4845efa549e 100644 --- a/app/controllers/concerns/idv_step_concern.rb +++ b/app/controllers/concerns/idv_step_concern.rb @@ -44,11 +44,9 @@ def confirm_document_capture_complete if flow_path == 'standard' redirect_to idv_document_capture_url - elsif flow_path == 'hybrid' && - IdentityConfig.store.doc_auth_link_sent_controller_enabled + elsif flow_path == 'hybrid' redirect_to idv_link_sent_url - else - flow_session.delete('Idv::Steps::DocumentCaptureStep') + else # no flow_path, go to UploadStep via FSM redirect_to idv_doc_auth_url end end diff --git a/app/controllers/idv/doc_auth_controller.rb b/app/controllers/idv/doc_auth_controller.rb index eaecee0fa96..ddd89045b8e 100644 --- a/app/controllers/idv/doc_auth_controller.rb +++ b/app/controllers/idv/doc_auth_controller.rb @@ -3,7 +3,6 @@ class DocAuthController < ApplicationController before_action :confirm_two_factor_authenticated before_action :redirect_if_pending_in_person_enrollment before_action :redirect_if_pending_profile - before_action :extend_timeout_using_meta_refresh_for_select_paths include IdvSession include Flow::FlowStateMachine @@ -21,7 +20,7 @@ class DocAuthController < ApplicationController FLOW_STATE_MACHINE_SETTINGS = { step_url: :idv_doc_auth_step_url, - final_url: :idv_document_capture_url, + final_url: :idv_link_sent_url, flow: Idv::Flows::DocAuthFlow, analytics_id: 'Doc Auth', }.freeze @@ -49,15 +48,6 @@ def update_if_skipping_upload update end - def extend_timeout_using_meta_refresh_for_select_paths - return unless request.path == idv_doc_auth_step_path(step: :link_sent) && flow_session - max_10min_refreshes = IdentityConfig.store.doc_auth_extend_timeout_by_minutes / 10 - return if max_10min_refreshes <= 0 - meta_refresh_count = flow_session[:meta_refresh_count].to_i - return if meta_refresh_count >= max_10min_refreshes - do_meta_refresh(meta_refresh_count) - end - def do_meta_refresh(meta_refresh_count) @meta_refresh = 10 * 60 flow_session[:meta_refresh_count] = meta_refresh_count + 1 diff --git a/app/services/idv/actions/redo_document_capture_action.rb b/app/services/idv/actions/redo_document_capture_action.rb index 62fb0f4d7a1..811642b321b 100644 --- a/app/services/idv/actions/redo_document_capture_action.rb +++ b/app/services/idv/actions/redo_document_capture_action.rb @@ -11,10 +11,6 @@ def call redirect_to idv_document_capture_url else mark_step_incomplete(:upload) - - if !IdentityConfig.store.doc_auth_link_sent_controller_enabled - mark_step_incomplete(:link_sent) - end end end end diff --git a/app/services/idv/flows/doc_auth_flow.rb b/app/services/idv/flows/doc_auth_flow.rb index 90c195abd21..466cda4c614 100644 --- a/app/services/idv/flows/doc_auth_flow.rb +++ b/app/services/idv/flows/doc_auth_flow.rb @@ -5,7 +5,6 @@ class DocAuthFlow < Flow::BaseFlow welcome: Idv::Steps::WelcomeStep, agreement: Idv::Steps::AgreementStep, upload: Idv::Steps::UploadStep, - link_sent: Idv::Steps::LinkSentStep, }.freeze STEP_INDICATOR_STEPS = [ diff --git a/app/services/idv/steps/link_sent_step.rb b/app/services/idv/steps/link_sent_step.rb deleted file mode 100644 index f0237500a23..00000000000 --- a/app/services/idv/steps/link_sent_step.rb +++ /dev/null @@ -1,68 +0,0 @@ -module Idv - module Steps - class LinkSentStep < DocAuthBaseStep - STEP_INDICATOR_STEP = :verify_id - - HYBRID_FLOW_STEPS = %i[upload link_sent document_capture] - - def self.analytics_visited_event - :idv_doc_auth_link_sent_visited - end - - def self.analytics_submitted_event - :idv_doc_auth_link_sent_submitted - end - - def call - return render_document_capture_cancelled if document_capture_session&.cancelled_at - return render_step_incomplete_error unless take_photo_with_phone_successful? - - # The doc capture flow will have fetched the results already. We need - # to fetch them again here to add the PII to this session - handle_document_verification_success(document_capture_session_result) - end - - def extra_view_variables - { phone: idv_session[:phone_for_mobile_flow] } - end - - private - - def handle_document_verification_success(get_results_response) - save_proofing_components - extract_pii_from_doc(get_results_response, store_in_session: true) - mark_steps_complete - flow_session[:flow_path] = @flow.flow_path - end - - def render_document_capture_cancelled - mark_steps_incomplete - redirect_to idv_url - failure(I18n.t('errors.doc_auth.document_capture_cancelled')) - end - - def render_step_incomplete_error - failure(I18n.t('errors.doc_auth.phone_step_incomplete')) - end - - def take_photo_with_phone_successful? - document_capture_session_result.present? && document_capture_session_result.success? - end - - def document_capture_session_result - @document_capture_session_result ||= begin - document_capture_session&.load_result || - document_capture_session&.load_doc_auth_async_result - end - end - - def mark_steps_complete - HYBRID_FLOW_STEPS.each { |step| mark_step_complete(step) } - end - - def mark_steps_incomplete - HYBRID_FLOW_STEPS.each { |step| mark_step_incomplete(step) } - end - end - end -end diff --git a/app/services/idv/steps/upload_step.rb b/app/services/idv/steps/upload_step.rb index 3b454710952..21dc0ff7a8f 100644 --- a/app/services/idv/steps/upload_step.rb +++ b/app/services/idv/steps/upload_step.rb @@ -75,8 +75,7 @@ def handle_phone_submission failure_reason: failure_reason, ) - if !failure_reason && - IdentityConfig.store.doc_auth_link_sent_controller_enabled + if !failure_reason flow_session[:flow_path] = 'hybrid' redirect_to idv_link_sent_url end @@ -97,8 +96,6 @@ def application end def bypass_send_link_steps - mark_step_complete(:link_sent) - flow_session[:flow_path] = 'standard' redirect_to idv_document_capture_url diff --git a/config/application.yml.default b/config/application.yml.default index 3aececcf79e..55e950c25d2 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -90,7 +90,6 @@ doc_auth_s3_request_timeout: 5 doc_auth_error_dpi_threshold: 290 doc_auth_error_glare_threshold: 40 doc_auth_error_sharpness_threshold: 40 -doc_auth_link_sent_controller_enabled: false doc_auth_max_attempts: 5 doc_auth_max_capture_attempts_before_tips: 3 doc_auth_max_capture_attempts_before_native_camera: 2 diff --git a/lib/identity_config.rb b/lib/identity_config.rb index a879db66881..293949132be 100644 --- a/lib/identity_config.rb +++ b/lib/identity_config.rb @@ -160,7 +160,6 @@ def self.build_store(config_map) config.add(:doc_auth_error_glare_threshold, type: :integer) config.add(:doc_auth_error_sharpness_threshold, type: :integer) config.add(:doc_auth_extend_timeout_by_minutes, type: :integer) - config.add(:doc_auth_link_sent_controller_enabled, type: :boolean) config.add(:doc_auth_max_attempts, type: :integer) config.add(:doc_auth_max_capture_attempts_before_native_camera, type: :integer) config.add(:doc_auth_max_submission_attempts_before_native_camera, type: :integer) diff --git a/spec/controllers/idv/doc_auth_controller_spec.rb b/spec/controllers/idv/doc_auth_controller_spec.rb index 50a1b1e45d4..df667ed9004 100644 --- a/spec/controllers/idv/doc_auth_controller_spec.rb +++ b/spec/controllers/idv/doc_auth_controller_spec.rb @@ -138,7 +138,7 @@ it 'finishes the flow' do get :show, params: { step: 'welcome' } - expect(response).to redirect_to idv_document_capture_url + expect(response).to redirect_to idv_link_sent_url end end end @@ -202,7 +202,7 @@ it 'finishes the flow' do put :update, params: { step: 'ssn' } - expect(response).to redirect_to idv_document_capture_url + expect(response).to redirect_to idv_link_sent_url end end end @@ -210,18 +210,4 @@ def mock_next_step(step) allow_any_instance_of(Idv::Flows::DocAuthFlow).to receive(:next_step).and_return(step) end - - let(:user) { create(:user, :fully_registered) } - let(:document_capture_session_uuid) { DocumentCaptureSession.create!(user: user).uuid } - - def mock_document_capture_step - stub_sign_in(user) - allow_any_instance_of(Flow::BaseFlow).to \ - receive(:flow_session).and_return( - 'document_capture_session_uuid' => document_capture_session_uuid, - 'Idv::Steps::WelcomeStep' => true, - 'Idv::Steps::LinkSentStep' => true, - 'Idv::Steps::UploadStep' => true, - ) - end end diff --git a/spec/controllers/idv/link_sent_controller_spec.rb b/spec/controllers/idv/link_sent_controller_spec.rb index c2491123c6d..038cf95f3ef 100644 --- a/spec/controllers/idv/link_sent_controller_spec.rb +++ b/spec/controllers/idv/link_sent_controller_spec.rb @@ -19,11 +19,7 @@ ) end - let(:feature_flag_enabled) { true } - before do - allow(IdentityConfig.store).to receive(:doc_auth_link_sent_controller_enabled). - and_return(feature_flag_enabled) allow(subject).to receive(:flow_session).and_return(flow_session) stub_sign_in(user) stub_analytics diff --git a/spec/controllers/idv/ssn_controller_spec.rb b/spec/controllers/idv/ssn_controller_spec.rb index b2fcbce6970..31ada7f5c31 100644 --- a/spec/controllers/idv/ssn_controller_spec.rb +++ b/spec/controllers/idv/ssn_controller_spec.rb @@ -203,7 +203,6 @@ before do flow_session[:flow_path] = 'standard' flow_session.delete('pii_from_doc') - flow_session['Idv::Steps::DocumentCaptureStep'] = true end it 'redirects to DocumentCaptureController on standard flow' do @@ -212,10 +211,16 @@ expect(response).to redirect_to idv_document_capture_url end - it 'redirects to FSM DocumentCaptureStep on hybrid flow' do + it 'redirects to LinkSentController on hybrid flow' do flow_session[:flow_path] = 'hybrid' put :update - expect(flow_session['Idv::Steps::DocumentCaptureStep']).to be_nil + expect(response.status).to eq 302 + expect(response).to redirect_to idv_link_sent_url + end + + it 'redirects to FSM UploadStep if there is no flow_path' do + flow_session[:flow_path] = nil + put :update expect(response.status).to eq 302 expect(response).to redirect_to idv_doc_auth_url end diff --git a/spec/features/idv/actions/cancel_link_sent_action_spec.rb b/spec/features/idv/actions/cancel_link_sent_action_spec.rb index e90d5e499e2..2cf54a9f177 100644 --- a/spec/features/idv/actions/cancel_link_sent_action_spec.rb +++ b/spec/features/idv/actions/cancel_link_sent_action_spec.rb @@ -4,11 +4,7 @@ include IdvStepHelper include DocAuthHelper - let(:new_controller_enabled) { false } - before do - allow(IdentityConfig.store).to receive(:doc_auth_link_sent_controller_enabled). - and_return(new_controller_enabled) sign_in_and_2fa_user complete_doc_auth_steps_before_link_sent_step end @@ -18,15 +14,4 @@ expect(page).to have_current_path(idv_doc_auth_upload_step) end - - context 'new SendLink controller is enabled' do - let(:new_controller_enabled) { true } - - it 'returns to link sent step', :js do - expect(page).to have_current_path(idv_link_sent_path) - click_doc_auth_back_link - - expect(page).to have_current_path(idv_doc_auth_upload_step) - end - end end diff --git a/spec/features/idv/actions/redo_document_capture_action_spec.rb b/spec/features/idv/actions/redo_document_capture_action_spec.rb index 3e6db6cf5e9..bc45ad8e775 100644 --- a/spec/features/idv/actions/redo_document_capture_action_spec.rb +++ b/spec/features/idv/actions/redo_document_capture_action_spec.rb @@ -4,12 +4,8 @@ include IdvStepHelper include DocAuthHelper - let(:new_controller_enabled) { false } - context 'when barcode scan returns a warning', allow_browser_log: true do before do - allow(IdentityConfig.store).to receive(:doc_auth_link_sent_controller_enabled). - and_return(new_controller_enabled) sign_in_and_2fa_user complete_doc_auth_steps_before_document_capture_step mock_doc_auth_attention_with_barcode @@ -84,25 +80,5 @@ expect(page).not_to have_css('[role="status"]') end end - - context 'with doc_auth_link_sent_controller_enabled flag enabled', - driver: :headless_chrome_mobile do - let(:new_controller_enabled) { true } - - it 'goes to document capture' do - warning_link_text = t('doc_auth.headings.capture_scan_warning_link') - - expect(page).to have_css( - '[role="status"]', - text: t( - 'doc_auth.headings.capture_scan_warning_html', - link: warning_link_text, - ).tr(' ', ' '), - ) - click_link warning_link_text - - expect(current_path).to eq(idv_document_capture_path) - end - end end end diff --git a/spec/features/idv/doc_auth/address_step_spec.rb b/spec/features/idv/doc_auth/address_step_spec.rb index ef0e6150f4e..62d36a3f4cc 100644 --- a/spec/features/idv/doc_auth/address_step_spec.rb +++ b/spec/features/idv/doc_auth/address_step_spec.rb @@ -97,7 +97,7 @@ it 'stays in FSM on hybrid flow' do complete_doc_auth_steps_before_link_sent_step visit(idv_address_url) - expect(page).to have_current_path(idv_doc_auth_link_sent_step) + expect(page).to have_current_path(idv_link_sent_path) end end end diff --git a/spec/features/idv/doc_auth/link_sent_spec.rb b/spec/features/idv/doc_auth/link_sent_spec.rb index cf3fee1d149..406aab2e3c4 100644 --- a/spec/features/idv/doc_auth/link_sent_spec.rb +++ b/spec/features/idv/doc_auth/link_sent_spec.rb @@ -11,8 +11,6 @@ before do allow(FeatureManagement). to(receive(:doc_capture_polling_enabled?).and_return(false)) - allow(IdentityConfig.store). - to(receive(:doc_auth_link_sent_controller_enabled).and_return(true)) user complete_doc_auth_steps_before_upload_step diff --git a/spec/features/idv/doc_auth/link_sent_step_spec.rb b/spec/features/idv/doc_auth/link_sent_step_spec.rb deleted file mode 100644 index 0d913c4dec1..00000000000 --- a/spec/features/idv/doc_auth/link_sent_step_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -require 'rails_helper' - -feature 'doc auth link sent step' do - include IdvStepHelper - include DocAuthHelper - include DocCaptureHelper - - let(:user) { sign_in_and_2fa_user } - let(:doc_capture_polling_enabled) { false } - let(:phone_number) { '415-555-0199' } - - before do - allow(FeatureManagement). - to(receive(:doc_capture_polling_enabled?).and_return(doc_capture_polling_enabled)) - user - complete_doc_auth_steps_before_upload_step - fill_in :doc_auth_phone, with: '' - fill_in :doc_auth_phone, with: phone_number - click_send_link - end - - it 'Correctly renders the link sent step page' do - expect(page).to have_current_path(idv_doc_auth_link_sent_step) - expect(page).to have_content(phone_number) - end -end diff --git a/spec/features/idv/doc_auth/upload_step_spec.rb b/spec/features/idv/doc_auth/upload_step_spec.rb index bf91ba524ca..41f316f58fa 100644 --- a/spec/features/idv/doc_auth/upload_step_spec.rb +++ b/spec/features/idv/doc_auth/upload_step_spec.rb @@ -61,7 +61,7 @@ click_send_link - expect(page).to have_current_path(idv_doc_auth_link_sent_step) + expect(page).to have_current_path(idv_link_sent_path) expect(fake_analytics).to have_logged_event( 'IdV: doc auth upload submitted', hash_including(step: 'upload', destination: :link_sent), @@ -86,7 +86,7 @@ fill_in :doc_auth_phone, with: '415-555-0199' click_send_link - expect(page).to have_current_path(idv_doc_auth_link_sent_step) + expect(page).to have_current_path(idv_link_sent_path) end it 'does not proceed to the next page with invalid info' do @@ -107,7 +107,7 @@ fill_in :doc_auth_phone, with: '415-555-0199' click_send_link - expect(page).to have_current_path(idv_doc_auth_link_sent_step) + expect(page).to have_current_path(idv_link_sent_path) end it 'does not proceed if Telephony raises an error' do @@ -169,7 +169,7 @@ fill_in :doc_auth_phone, with: '415-555-0199' click_send_link - expect(page).to have_current_path(idv_doc_auth_link_sent_step) + expect(page).to have_current_path(idv_link_sent_path) click_doc_auth_back_link end @@ -196,7 +196,7 @@ travel_to(Time.zone.now + idv_send_link_attempt_window_in_minutes.minutes) do fill_in :doc_auth_phone, with: '415-555-0199' click_send_link - expect(page).to have_current_path(idv_doc_auth_link_sent_step) + expect(page).to have_current_path(idv_link_sent_path) end end diff --git a/spec/features/idv/hybrid_mobile/hybrid_mobile_spec.rb b/spec/features/idv/hybrid_mobile/hybrid_mobile_spec.rb index e444817f816..fe223ba1ef6 100644 --- a/spec/features/idv/hybrid_mobile/hybrid_mobile_spec.rb +++ b/spec/features/idv/hybrid_mobile/hybrid_mobile_spec.rb @@ -105,71 +105,4 @@ expect(page).to have_content(t('doc_auth.headings.text_message')) end end - - # delete this whole context when the feature flag is deleted - context 'with doc_auth_link_sent_controller_enabled set to true' do - before do - allow(IdentityConfig.store).to receive(:doc_auth_link_sent_controller_enabled). - and_return(true) - end - - it 'proofs and hands off to mobile', js: true do - user = nil - - perform_in_browser(:desktop) do - user = sign_in_and_2fa_user - complete_doc_auth_steps_before_upload_step - clear_and_fill_in(:doc_auth_phone, phone_number) - click_send_link - - expect(page).to have_content(t('doc_auth.headings.text_message')) - - # Confirm that Continue button is not shown when polling is enabled - expect(page).not_to have_content(t('doc_auth.buttons.continue')) - end - - expect(@sms_link).to be_present - - perform_in_browser(:mobile) do - visit @sms_link - - # Confirm app disallows jumping ahead to CaptureComplete page - visit idv_hybrid_mobile_capture_complete_url - expect(page).to have_current_path(idv_hybrid_mobile_document_capture_url) - - attach_and_submit_images - - expect(page).to have_current_path(idv_hybrid_mobile_capture_complete_url) - expect(page).to have_content(t('doc_auth.headings.capture_complete').tr(' ', ' ')) - expect(page).to have_text(t('doc_auth.instructions.switch_back')) - expect_step_indicator_current_step(t('step_indicator.flows.idv.verify_id')) - - # Confirm app disallows jumping back to DocumentCapture page - visit idv_hybrid_mobile_document_capture_url - expect(page).to have_current_path(idv_hybrid_mobile_capture_complete_url) - end - - perform_in_browser(:desktop) do - expect(page).to_not have_content(t('doc_auth.headings.text_message'), wait: 10) - expect(page).to have_current_path(idv_ssn_path) - - fill_out_ssn_form_ok - click_idv_continue - - expect(page).to have_content(t('headings.verify')) - click_idv_continue - - fill_out_phone_form_ok - verify_phone_otp - - fill_in t('idv.form.password'), with: Features::SessionHelper::VALID_PASSWORD - click_idv_continue - - acknowledge_and_confirm_personal_key - - expect(page).to have_current_path(account_path) - expect(page).to have_content(t('headings.account.verified_account')) - end - end - end end diff --git a/spec/support/features/doc_auth_helper.rb b/spec/support/features/doc_auth_helper.rb index f0490bd221f..1d54ffe2caa 100644 --- a/spec/support/features/doc_auth_helper.rb +++ b/spec/support/features/doc_auth_helper.rb @@ -65,10 +65,6 @@ def idv_doc_auth_upload_step idv_doc_auth_step_path(step: :upload) end - def idv_doc_auth_link_sent_step - idv_doc_auth_step_path(step: :link_sent) - end - def complete_doc_auth_steps_before_welcome_step(expect_accessible: false) visit idv_doc_auth_welcome_step unless current_path == idv_doc_auth_welcome_step click_idv_continue if current_path == idv_mail_only_warning_path