LG-14094 Stop logging extra “IdV: doc auth verify visited” events#11124
Merged
LG-14094 Stop logging extra “IdV: doc auth verify visited” events#11124
Conversation
This commit makes changes to the way to `VerifyInfoController#show` logs events in the main IdV and in-person contexts. This controller action has 2 primary concerns: 1. Rendering the “Verify your information” page 2. Managing the results of the `ResolutionProofingJob` that runs when the “Verify your information” page is submitted Which concern is active for these actions is controlled by the `async_state` which is a `ProofingSessionAsyncResult`. This is a struct that includes the status of the `ResolutionProofingJob`. This status can have 4 values: - `NONE`: This means that no job has been submitted. In this state the controller should render the “Verify your information” page. - `IN_PROGRESS`: This means that the job is running. In this state the controller should render a loading state page that is detected by the `form-steps-wait` tooling on the frontend causing it to render a loading state. - `DONE`: The job has been completed. In this state the controller should process the results and redirect appropriately. - `MISSING`: The result is expected but not present. This indicates that the job has timed out. In this state the controller should render the “Verify your information” page with an error. In addition to these states the controller is aware of rate limits for the purpose of redirecting to a rate limit action when the user has been rate limited. Prior to this commit, these states had the following associated analytics actions: - `IdV: doc auth verify visited`: This event was previously logged in all cases. This event is the focus of this change. - `IdV: doc auth verify proofing results`: This event is logged when `async_state.status` is `DONE`. This event includes a large hash containing the results of running `ResolutionProofingJob`. - `IdV: proofing resolution result missing`: This event is logged when `async_state.status` is `MISSING`. - `Rate Limit Reached`: This event is logged by `RateLimitConcern` when a rate-limit is exceeded and the user is being redirected as a result. Since the `IdV: doc auth verify visited` was logged in all cases there was a lot of double counting of verify step visits. For example, if a user visited the page, submitted it, has 2 polling attempts, and then sees the job complete on the 3rd attempt then they will have 4 `IdV: doc auth verify visited` events in the log. This pattern has led to some confusion since this user has only visited this step once. This commit makes a change so that the `IdV: doc auth verify visited` is only logged when `async_state.status` is `NONE`, i.e. when the user is viewing the “Verify your information” screen to submit their info. All of the other values of `async_state.status` are covered by an existing analytics event except for `IN_PROGRESS`. This commit adds a new `idv_doc_auth_verify_polling_wait_visited` to ensure that this state is covered by logging. [skip changelog]
app/services/analytics_events.rb
Outdated
Comment on lines
+1645
to
+1646
| def idv_doc_auth_verify_polling_wait_visited(**extra) | ||
| track_event(:idv_doc_auth_verify_polling_wait_visited, **extra) |
Contributor
There was a problem hiding this comment.
if there's no arguments ever used I think we can drop **extra I think
Contributor
Author
There was a problem hiding this comment.
I hadn't noticed that pattern on the other events like that in here. Willfix!
Contributor
There was a problem hiding this comment.
This is relevant to some work I'm doing as well and I am 👍 on excluding **extra if possible
matthinz
reviewed
Aug 21, 2024
| end | ||
| end | ||
|
|
||
| context 'when the reolution proofing job result is missing' do |
Contributor
There was a problem hiding this comment.
Suggested change
| context 'when the reolution proofing job result is missing' do | |
| context 'when the resolution proofing job result is missing' do |
matthinz
approved these changes
Aug 21, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit makes changes to the way to
VerifyInfoController#showlogs events in the main IdV and in-person contexts.This controller action has 2 primary concerns:
ResolutionProofingJobthat runs when the “Verify your information” page is submittedWhich concern is active for these actions is controlled by the
async_statewhich is aProofingSessionAsyncResult. This is a struct that includes the status of theResolutionProofingJob. This status can have 4 values:NONE: This means that no job has been submitted. In this state the controller should render the “Verify your information” page.IN_PROGRESS: This means that the job is running. In this state the controller should render a loading state page that is detected by theform-steps-waittooling on the frontend causing it to render a loading state.DONE: The job has been completed. In this state the controller should process the results and redirect appropriately.MISSING: The result is expected but not present. This indicates that the job has timed out. In this state the controller should render the “Verify your information” page with an error.In addition to these states the controller is aware of rate limits for the purpose of redirecting to a rate limit action when the user has been rate limited.
Prior to this commit, these states had the following associated analytics actions:
IdV: doc auth verify visited: This event was previously logged in all cases. This event is the focus of this change.IdV: doc auth verify proofing results: This event is logged whenasync_state.statusisDONE. This event includes a large hash containing the results of runningResolutionProofingJob.IdV: proofing resolution result missing: This event is logged whenasync_state.statusisMISSING.Rate Limit Reached: This event is logged byRateLimitConcernwhen a rate-limit is exceeded and the user is being redirected as a result.Since the
IdV: doc auth verify visitedwas logged in all cases there was a lot of double counting of verify step visits. For example, if a user visited the page, submitted it, has 2 polling attempts, and then sees the job complete on the 3rd attempt then they will have 4IdV: doc auth verify visitedevents in the log. This pattern has led to some confusion since this user has only visited this step once.This commit makes a change so that the
IdV: doc auth verify visitedis only logged whenasync_state.statusisNONE, i.e. when the user is viewing the “Verify your information” screen to submit their info.All of the other values of
async_state.statusare covered by an existing analytics event except forIN_PROGRESS. This commit adds a newidv_doc_auth_verify_polling_wait_visitedto ensure that this state is covered by logging.