-
Notifications
You must be signed in to change notification settings - Fork 166
LG-12075: Rename attempt properties in analytics for clarity #10011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
96a1f16
43e1f45
b0aef35
8f2364c
80f0281
7d61c91
3da5504
63a5d02
0129914
6bb1e44
153866a
9ee83f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ class PhoneErrorsController < ApplicationController | |
| before_action :ignore_form_step_wait_requests | ||
|
|
||
| def warning | ||
| @remaining_attempts = rate_limiter.remaining_count | ||
| @remaining_submit_attempts = rate_limiter.remaining_count | ||
|
|
||
| if idv_session.previous_phone_step_params | ||
| @phone = idv_session.previous_phone_step_params[:phone] | ||
|
|
@@ -21,12 +21,12 @@ def warning | |
| end | ||
|
|
||
| def timeout | ||
| @remaining_step_attempts = rate_limiter.remaining_count | ||
| @remaining_submit_attempts = rate_limiter.remaining_count | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The controller did have a method that was
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @night-jellyfish , can you point to where is the method?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good point. It doesn't seem like it's ever called, outside of the spec files. Perhaps it can just be removed then?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @night-jellyfish , i think like That raises another question why we create a new Anyway, interesting details.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh interesting! I don't fully understand the ins and outs of Redis, but that sounds plausible. Do you think it's worth a refactoring ticket to only create a new instance once?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @night-jellyfish , i think it's fine to leave it as is, for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. Just for my own understanding then - are you saying it'd be better to re-use the same RateLimiter instance because we could just reuse a single row in the Redis DB vs creating a new row each time? |
||
| track_event(type: :timeout) | ||
| end | ||
|
|
||
| def jobfail | ||
| @remaining_attempts = rate_limiter.remaining_count | ||
| @remaining_submit_attempts = rate_limiter.remaining_count | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried creating a private method in the controller so that the method
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @night-jellyfish , which test failed? I changed to private method and the spec and feature test for phone_errors_controller seems fine.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strange! I just tried again. When I try I get 2 failures: from When I stop using the private method, they pass again. |
||
| track_event(type: :jobfail) | ||
| end | ||
|
|
||
|
|
@@ -63,7 +63,7 @@ def track_event(type:) | |
| if type == :failure | ||
| attributes[:limiter_expires_at] = @expires_at | ||
| else | ||
| attributes[:remaining_attempts] = @remaining_attempts | ||
| attributes[:remaining_submit_attempts] = @remaining_submit_attempts | ||
| end | ||
|
|
||
| analytics.idv_phone_error_visited(**attributes) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this attribut/property is used in ui erb file? If we renamed it, we will need rename there if used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's correct! I renamed it here.
The var we talked about above in the timeout method, I can't find in use anywhere outside the spec. It should be in use by
app/views/idv/phone_errors/timeout.html.erb, but it isn't, even inmain.That's why I think maybe that one could be deleted entirely? But it does seem outside the scope of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@night-jellyfish , how about here?
identity-idp/app/views/idv/phone_errors/warning.html.erb
Lines 30 to 32 in eb7aa03
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! That's the one I changed in the first link in my previous comment.