Skip to content

LG-12365 Log rate limit status on verify-by-mail enter-code controller#10324

Merged
jmhooper merged 1 commit intomainfrom
jmhooper-gpo-enter-code-rate-limit-logging
Mar 27, 2024
Merged

LG-12365 Log rate limit status on verify-by-mail enter-code controller#10324
jmhooper merged 1 commit intomainfrom
jmhooper-gpo-enter-code-rate-limit-logging

Conversation

@jmhooper
Copy link
Contributor

We have several rate limits that are enforced when the user visits the verify-by-mail code entry screen:

  1. OTP Rate-Limit: This limit applies to OTP entries. After the user has entered too many OTPs this is enforced and the user is redirected to an error screen.
  2. Letter request limit: This limit applies to letter requests. After the user has requested too many letters or if the users profile is too old the user no longer sees the option to request a new letter.

The enter code screen enforced these limits but did not add any indicator to the logs that it was doing so. This commit adds properties to the analytics event for each of these cases so we can monitor how the app is behaving.

We have serveral rate limits that are enforced when the user visits the verify-by-mail code entry screen:

1. _OTP Rate-Limit_: This limit applies to OTP entries. After the user has entered too many OTPs this is enforced and the user is redirected to an error screen.
2. _Letter request limit_: This limit applies to letter requests. After the user has requested too many letters or if the users profile is too old the user no longer sees the option to request a new letter.

The enter code screen enforced these limits but did not add any indicator to the logs that it was doing so. This commit adds properties to the analytics event for each of these cases so we can monitor how the app is behaving.

[skip changelog]
@jmhooper jmhooper requested a review from a team March 27, 2024 14:40
analytics.idv_verify_by_mail_enter_code_visited(
source: if @user_did_not_receive_letter then 'gpo_reminder_email' end,
otp_rate_limited: rate_limiter.limited?,
user_can_request_another_letter: @can_request_another_letter,
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels to me like can_request_another_letter belongs as a method on Idv::GpoMail.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we care why they can't request another letter? i.e. do we want to log the profile_too_old? and rate_limited? values?

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 think that we could, yeah here, yes. I'm about to do some work on this controller to address this AC on LG-11753

The error banner for "Incorrect verification code" now is prompted under the input field as "Incorrect verification code"

I'll incorporate this thought there

@jmhooper jmhooper merged commit 76be4ab into main Mar 27, 2024
@jmhooper jmhooper deleted the jmhooper-gpo-enter-code-rate-limit-logging branch March 27, 2024 18:34
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