Fix some nil session data errors (LG-4810)#5215
Conversation
| def download | ||
| data = user_session[:personal_key] + "\r\n" | ||
| send_data data, filename: 'personal_key.txt' | ||
| if user_session[:personal_key].present? |
There was a problem hiding this comment.
Although unlikely in the real-world, the new test case seems to illustrate the root cause here. Maybe worth filing separately, but I'd wonder if we could change the logic to not rely on #show having previously been visited, i.e. call something similar to finish_idv_session as a before_action, or set to user_session from ReviewController#create as part of the profile creation, or change this to call personal_key, etc.
There was a problem hiding this comment.
Good point! I filed https://cm-jira.usa.gov/browse/LG-4847 to follow up on that.
Part of my thinking is, there shouldn't be a code to download if the user hasn't viewed it first, so the ordering does make some sense to me. We can noodle on it and follow up
| data = user_session[:personal_key] + "\r\n" | ||
| send_data data, filename: 'personal_key.txt' | ||
| else | ||
| Rails.logger.warn('no personal_key in user_session') |
There was a problem hiding this comment.
Should we make an analytics event for the pkey download? That way we'd get all the goodies that come along with that, like session and user IDs.
There was a problem hiding this comment.
Good point, will update that and then do success: true/false instead of separate events
* Fix NoMethodError + on nil in MfaConfirmationController * Fix NoMethodError + on nil in IdvConfirmationsController
No description provided.