Skip to content

LG-14127 Stop deleting TMx session ID when undoing SSN step#11091

Merged
jmhooper merged 3 commits intomainfrom
jmhooper-dont-delete-tmx-session-id
Aug 21, 2024
Merged

LG-14127 Stop deleting TMx session ID when undoing SSN step#11091
jmhooper merged 3 commits intomainfrom
jmhooper-dont-delete-tmx-session-id

Conversation

@jmhooper
Copy link
Contributor

The SSN show page includes Javascript for device profiling. To identify a device profiling transaction we set threatmetrix_session_id and render that alongside the Javascript that performs the device profiling. This UUID is used downstream to fetch device profiling results.

We observed that some users did not have a threatmetrix_session_id value in downstream steps. In many cases this appears to be because they submitted the "link sent" step which calls undo_step on the SSN step. Then, either due to network issues or an unusual path through the process they were able to submit the SSN form without re-rendering the SSN show page and regenerating a threatmetrix session ID.

Investigating this we questioned why the threatmetrix session id needs to be deleted when the user submits earlier steps. It appears it was added in #9589 which configured the back button functionality from the SSN step back to other steps. It appears that the threatmetrix session id was set to nil there in order to return to the state that existed before the step was submitted and not because of a specific concern about stale IDs or anything like that.

In order to prevent the issue where users have a nil ID after viewing the SSN step and submitting ealier steps and proceeding without re-viewing the SSN step, this commit removes the code to reset the threatmetrix session ID. This should be fine since the old ID will represent a device profiling transaction for the current session which is ultimately the goal.

The SSN show page includes Javascript for device profiling. To identify a device profiling transaction we set `threatmetrix_session_id` and render that alongside the Javascript that performs the device profiling. This UUID is used downstream to fetch device profiling results.

We observed that some users did not have a `threatmetrix_session_id` value in downstream steps. This appears to be because they submitted the "link sent" step which calls `undo_step` on the SSN step. Then, either due to network issues or an unusual path through the process they were able to submit the SSN form without re-rendering the SSN show page.

Investigating this we questioned why the `threatmetrix_session_id` needs to be deleted when the user submits earlier steps. It appears it was added in #9589 which configured the back button functionality from the SSN step back to other steps. It appears that the `threatmetrix_session_id` was set to `nil` there in order to return to the state that existed before the step was submitted and not because of a specific concern about stale IDs or anything like that.

In order to prevent the issue where users have a nil ID after viewing the SSN step but submitting later steps and proceeding without re-viewing the SSN step, this commit removes the code to reset the threatmetrix session ID. This should be fine since the old ID will represent a device profiling transaction for the current session which is ultimately the goal.

[skip changelog]
@jmhooper jmhooper requested a review from matthinz August 15, 2024 17:37
expect(idv_session.had_barcode_attention_error).to be_nil

expect(idv_session.ssn).to be_nil
expect(idv_session.threatmetrix_session_id).to be_nil
Copy link
Contributor

Choose a reason for hiding this comment

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

should we assert that it is not nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can, though with this change the threatmetrix_sesison_id is no longer something the FlowPolicy cares about. Setting it and adding an assertion that it is not nil may be confusing with the context of this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok would it make sense in the context of preserving the value to add a spec elsewhere in the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a test in aad6079

@jmhooper jmhooper merged commit 5f0c901 into main Aug 21, 2024
@jmhooper jmhooper deleted the jmhooper-dont-delete-tmx-session-id branch August 21, 2024 13:12
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.

3 participants