Skip to content

LG-14094 Stop logging extra “IdV: doc auth verify visited” events#11124

Merged
jmhooper merged 2 commits intomainfrom
jmhooper-verify-info-analytics
Aug 22, 2024
Merged

LG-14094 Stop logging extra “IdV: doc auth verify visited” events#11124
jmhooper merged 2 commits intomainfrom
jmhooper-verify-info-analytics

Conversation

@jmhooper
Copy link
Contributor

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.

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]
@jmhooper jmhooper requested a review from a team August 21, 2024 14:26
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)
Copy link
Contributor

Choose a reason for hiding this comment

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

if there's no arguments ever used I think we can drop **extra I think

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 hadn't noticed that pattern on the other events like that in here. Willfix!

Copy link
Contributor

Choose a reason for hiding this comment

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

This is relevant to some work I'm doing as well and I am 👍 on excluding **extra if possible

end
end

context 'when the reolution proofing job result is missing' do
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
context 'when the reolution proofing job result is missing' do
context 'when the resolution proofing job result is missing' do

@matthinz matthinz requested a review from a team August 21, 2024 16:51
@jmhooper jmhooper merged commit 57b4cc3 into main Aug 22, 2024
@jmhooper jmhooper deleted the jmhooper-verify-info-analytics branch August 22, 2024 14:17
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