Skip to content

LG-16729 Add Preconditions to ChooseIdTypeController's Flow Policy#12537

Merged
WilliamBirdsall merged 1 commit intomainfrom
will/LG-16729
Oct 6, 2025
Merged

LG-16729 Add Preconditions to ChooseIdTypeController's Flow Policy#12537
WilliamBirdsall merged 1 commit intomainfrom
will/LG-16729

Conversation

@WilliamBirdsall
Copy link
Copy Markdown
Contributor

@WilliamBirdsall WilliamBirdsall commented Sep 29, 2025

🎫 Ticket

Link to the relevant ticket:
LG-16729

🛠 Summary of changes

Add Preconditions to ChooseIdTypeController

Notes:

  • The previous ticket that this ticket depends on adds tests to flow_policy_spec.
  • This ticket specifies adding preconditions to the hybrid choose id type controller but hybrid does not use the flow policy.

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • Step 1: Create new account and navigate a few screen into IPP.
  • Step 2: Attempt to navigate via a URL change to verify/choose_id_type
  • Step 3: Ensure you are not navigated there

Comment on lines +51 to +57
idv_session.flow_path == 'standard' && (
!idv_session.skip_doc_auth_from_handoff || # is not ipp from desktop
idv_session.skip_hybrid_handoff || # is not mobile user
!idv_session.skip_doc_auth_from_how_to_verify || # is not ipp user
!idv_session.selfie_check_required || # desktop but selfie not required
idv_session.desktop_selfie_test_mode_enabled?
)
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.

Suggested change
idv_session.flow_path == 'standard' && (
!idv_session.skip_doc_auth_from_handoff || # is not ipp from desktop
idv_session.skip_hybrid_handoff || # is not mobile user
!idv_session.skip_doc_auth_from_how_to_verify || # is not ipp user
!idv_session.selfie_check_required || # desktop but selfie not required
idv_session.desktop_selfie_test_mode_enabled?
)
idv_session.flow_path == 'standard' &&
!idv_session.skip_doc_auth_from_handoff && # is not ipp from desktop
!idv_session.skip_doc_auth_from_how_to_verify

Copy link
Copy Markdown
Contributor

@amirbey amirbey Sep 30, 2025

Choose a reason for hiding this comment

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

selfie_check_required is no longer relevant ...
and ,the standard_flow is true if either idv_session.desktop_selfie_test_mode_enabled? or idv_session.skip_hybrid_handoff is true

for hybrid flow:
i think adding a before filter to hybrid document_capture_controller:

def id_type_chosen?
  document_capture_session.passport_status.present?
end

Copy link
Copy Markdown
Contributor Author

@WilliamBirdsall WilliamBirdsall Sep 30, 2025

Choose a reason for hiding this comment

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

There is already a before action on hybrid doc capture controller:

before_action :ensure_choose_id_type_completed, only: :show

Would this suffice?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It appears to be doing the same check

@WilliamBirdsall WilliamBirdsall marked this pull request as ready for review October 1, 2025 14:09
Copy link
Copy Markdown
Contributor

@solipet solipet left a comment

Choose a reason for hiding this comment

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

Tested against the branch and against main - worked great!

Could we add a feature spec to demonstrate this? Maybe in spec/features/idv/doc_auth/choose_id_type_spec.rb?

@WilliamBirdsall
Copy link
Copy Markdown
Contributor Author

WilliamBirdsall commented Oct 2, 2025

Spec test added!

Copy link
Copy Markdown
Contributor

@shanechesnutt-ft shanechesnutt-ft left a comment

Choose a reason for hiding this comment

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

LGTM! 👍🏻

changelog: Bug Fixes, Flow Policy, Add Preconditions to ChooseIdTypeController
Copy link
Copy Markdown
Contributor

@solipet solipet left a comment

Choose a reason for hiding this comment

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

LGTM

@WilliamBirdsall WilliamBirdsall merged commit 08216e9 into main Oct 6, 2025
1 check passed
@WilliamBirdsall WilliamBirdsall deleted the will/LG-16729 branch October 6, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants