LG-9784 New Hybrid Handoff Controller fka Upload Step#8407
Conversation
Co-authored-by: Sonia Connolly <sonia.connolly@gsa.gov> Co-authored-by: Amir Reavis-Bey <amir.reavis-bey@gsa.gov> changelog: Internal, FSM Removal, Add new controller for hybrid handoff (feature-flagged)
Adding initial update method(s) and single passing test using it
Co-authored-by: Sonia Connolly <sonia.connolly@gsa.gov>
Updated the flow hashes for steps and final_url to conditionally add the Upload step based on the presence/absence of the config flag
Analytics always need a bucket value for the Acuant AB Test, and will provide :default if you pass in nil.
Conditional FSM settings don't work well with CI
-- Why The original upload step spec did not test for the presence of the acuant analytics at all. We added this check to the _new_ controller test, but it's unclear that we want to even log acuant ab testing information at this step. We are also restoring the removed code in the acuant concern which checked for the presence of a document capture session uuid before returning any value
soniaconnolly
left a comment
There was a problem hiding this comment.
LGTM! Some comments, and a query about a feature test enclosing context.
Findings from testing locally:
-
Basic functionality works great. It goes to the page from Agreement with the flag set.
-
Throttling works on sending link.
-
On the hybrid_handoff page, visiting link_sent early redirects to document_capture instead of back to hybrid_handoff. I think this is worth investigating, but not a blocker to merge. The back button works!
-
Visiting hybrid_handoff from the hybrid_mobile flow 500s because of a before action using current_user. I'm going to put in a PR on main for that.
-
Can click back to get to hybrid_handoff after submitting docs, but clicking upload photos goes straight to SSN step because of guards in document_capture. We should either put a guard on hybrid_handoff if there's already pii in session, or remove the guards in document_capture. Again, I don't think this should block merging.
| idv_session.phone_for_mobile_flow = params[:doc_auth][:phone] | ||
| flow_session[:phone_for_mobile_flow] = idv_session.phone_for_mobile_flow |
There was a problem hiding this comment.
Noting here that when we're ready to delete the feature flag, we'll stop adding flow_session[:phone_for_mobile_flow] and start reading it from idv_session in LinkSentController.
| errors: { message: telephony_result.error&.friendly_message }, | ||
| extra: { | ||
| telephony_response: telephony_result.to_h, | ||
| destination: :link_sent, |
There was a problem hiding this comment.
Wondering if we still need destination in analytics or if we can delete that everywhere.
| before_action :confirm_agreement_step_complete | ||
|
|
||
| def show | ||
| flow_session[:flow_path] = 'standard' |
There was a problem hiding this comment.
Setting flow_path here so it will show up in analytics, although it doesn't really make sense if they haven't chosen a flow_path yet.
There was a problem hiding this comment.
I believe this is done to get it into the analytics so we can make a GET request to the document capture controller. An alternative approach may be to set this param in the document capture controller or link sent controller methods. That way the last one the user visits will persist for the rest of the flow.
| if flow_session[:flow_path] == 'standard' | ||
| redirect_to idv_document_capture_url |
There was a problem hiding this comment.
We're checking for flow_path == standard here because link_sent is currently the final url for DocAuthFlow. We'll need to think through this again when we change the final url again.
| and_return(fake_attempts_tracker) | ||
| end | ||
|
|
||
| context 'on a desktop device', js: true do |
There was a problem hiding this comment.
Do we need js: true? I believe this enclosing context is left over from when there was a mobile -> desktop flow, so it could be deleted to leave the specs at the top level. Or renamed to say the feature flag is set, and add a 404 test at the bottom for when the feature flag is not set. Optional, since that's in the controller tests already.
There was a problem hiding this comment.
Unfortunately we need the JS here because anything with phone numbers gets cleaned up client side, so the numbers won't match otherwise
| **analytics_arguments.merge(form_response(destination: :link_sent).to_h), | ||
| ) | ||
|
|
||
| telephony_form_response |
There was a problem hiding this comment.
Returning the form response object is a relic of the flow state machine. I don't think we need it anymore. I think we should move the analytics call up with the irs_attempts_api_tracker call and then let the failure_reason conditional be the last thing we do here.
There was a problem hiding this comment.
Unfortunately analytics_arguments needs to read from the flow_session to get the correct :flow_path, and that is only set on line 62 in hybrid cases. If analytics is moved before that line it will report the incorrect flow path. But agree on returning the response
There was a problem hiding this comment.
gotcha. regardless I don't think we need this return
| <%= simple_form_for( | ||
| :doc_auth, | ||
| url: url_for(type: :desktop), | ||
| method: 'PUT', |
There was a problem hiding this comment.
We discussed making this a link. Did we decide not to take that approach in this changeset?
There was a problem hiding this comment.
I decided against it for now because there were too many unknowns. For example, if we change how we are using the flow session to update/read the flow_path, we lose the ability to set it to standard explicitly in the form handler for manual upload (see bypass_send_link_steps). In the same vein, we would need to decide whether we really need an analytics call when users click that option, and, if so, whether that call would now happen on the frontend
There was a problem hiding this comment.
Since we're setting flow_path to standard on :show, that might make it easier to make this a link. Good point about analytics though.
🎫 Ticket
LG-9784
🛠 Summary of changes
Adding new HybridHandoffController with show method, view, and specs. This controller is behind a feature flag and is set to false by default.
Do not merge until #8394 has been merged and deployed.