LG-9371 Add flow_path back to upload submitted analytics#8528
LG-9371 Add flow_path back to upload submitted analytics#8528soniaconnolly merged 3 commits intomainfrom
Conversation
Analytics are sent separately from hybrid and standard code paths, and there were no specs on the standard path [skip changelog]
…osen Confirmed by looking at UpdateStep logs that the telephony form response is added to analytics
| analytics.idv_doc_auth_upload_submitted( | ||
| **analytics_arguments.merge(response.to_h), | ||
| ) | ||
| analytics_args = analytics_arguments.merge(form_response(destination: :document_capture).to_h) |
There was a problem hiding this comment.
question: could analytics_args be named to better suggest how it now differs from analytics_arguments?
There was a problem hiding this comment.
Addressed in bf0985d by removing the temp variable.
| **analytics_arguments.merge(response.to_h), | ||
| ) | ||
| analytics_args = analytics_arguments.merge(form_response(destination: :document_capture).to_h) | ||
| analytics_args[:flow_path] = flow_session[:flow_path] |
There was a problem hiding this comment.
question: if flow_session[:flow_path] couldn't be anything other than 'standard' as assigned in line 121 above, could you assign 'standard' here directly? (right now what's being assigned here is a bit obfuscated, but you may genuinely not know)
There was a problem hiding this comment.
I rearranged the code so the assignments are further apart. My sense is that the code is more resilient if the value is only assigned at decision points, and then accessed elsewhere. Could go either way though.
| analytics_id: 'Doc Auth', | ||
| irs_reproofing: false, | ||
| skip_upload_step: false } | ||
| end |
There was a problem hiding this comment.
nitpicks:
- preserve the key order in
analytics_argsassignment for easier comparison acrosscontexts. - standardize the indentation:
{
success: true,
errors: { message: nil },
analytics_id: 'Doc Auth',
destination: :link_sent,
flow_path: 'hybrid',
irs_reproofing: false,
step: 'upload',
telephony_response: {
errors: {},
message_id: 'fake-message-id',
request_id: 'fake-message-request-id',
success: true
}
}
Remove analytics args variable, re-order spec hashes to match
In HybridHandoffController, analytics are sent separately from hybrid and standard code paths, and there were no specs on the standard path. Add flow_path back in on the standard path.
Use the telephony_form_response for analytics on the hybrid path. I checked in events.log for UploadStep, and that's what it does.