Skip to content

Comments

LG-9865: Add same_address_as_id to in person verify visited analytics#8585

Merged
gina-yamada merged 7 commits intomainfrom
gyamada/fix-verify-info-analytics
Jun 13, 2023
Merged

LG-9865: Add same_address_as_id to in person verify visited analytics#8585
gina-yamada merged 7 commits intomainfrom
gyamada/fix-verify-info-analytics

Conversation

@gina-yamada
Copy link
Contributor

@gina-yamada gina-yamada commented Jun 12, 2023

🎫 Ticket

LG-9865 Work for Remove In Person Verify

🛠 Summary of changes

Add same_address_as_id to in person verify visited analytics

Comment on lines 84 to 92
def extra_analytics_properties
extra = {
pii_like_keypaths: [[:same_address_as_id], [:state_id, :state_id_jurisdiction]],
}
unless flow_session[:pii_from_user]&.[](:same_address_as_id).nil?
extra[:same_address_as_id] =
flow_session[:pii_from_user][:same_address_as_id].to_s == 'true'
end
extra
Copy link
Contributor

Choose a reason for hiding this comment

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

Eventually you'll want this method in a shared concern as you move more steps out of the FSM, but it makes sense to leave it here for now.

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 created an issue to handle this in the next step.

irs_reproofing: false,
step: 'verify',
same_address_as_id: true,
pii_like_keypaths: [[:same_address_as_id], [:state_id, :state_id_jurisdiction]],
Copy link
Contributor

Choose a reason for hiding this comment

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

I just checked, and the first thing Analytics#track_events does is attributes.delete(:pii_like_keypaths), so that's why they don't show up in the feature specs.

}
unless flow_session[:pii_from_user]&.[](:same_address_as_id).nil?
extra[:same_address_as_id] =
flow_session[:pii_from_user][:same_address_as_id].to_s == 'true'
Copy link
Contributor

@JackRyan1989 JackRyan1989 Jun 13, 2023

Choose a reason for hiding this comment

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

Just curious, but why are we coercing to a string here? Do we not know the type of :same_address_as_id?

In the spec it's a boolean, so if that's the case then you shouldn't have to coerce the type or compare the value.

Copy link
Contributor Author

@gina-yamada gina-yamada Jun 13, 2023

Choose a reason for hiding this comment

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

@JackRyan1989 This bit of code was taken from in_person_flow.rb, I kept it the exact same as is it just missing on analytics when moving verify out of the flow state machine (discovered in the delete PR). There is a ticket, LG-9543, to refactor all string instances of same_address_as_id to a boolean because both are being used. That ticket was started but presented roadblocks. How do you feel about that being handled in ticket LG-9543?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good!

Super nit: Maybe change the "same_address_as_id" to be a string in the test then? This is not a blocking comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not needed. Analytic data is a boolean. @JackRyan1989 and I jumped on a call.

@tomas-nava tomas-nava changed the title Add same_address_as_id to in person verify visited analytics LG-9865: Add same_address_as_id to in person verify visited analytics Jun 13, 2023
Copy link
Contributor

@sheldon-b sheldon-b left a comment

Choose a reason for hiding this comment

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

Couple of minor comments, otherwise lgtm!

gina-yamada and others added 2 commits June 13, 2023 14:33
Updated comment to include more detail for following line of code

Co-authored-by: Sheldon Bachstein <sheldon.bachstein@gsa.gov>
Co-authored-by: Sheldon Bachstein <sheldon.bachstein@gsa.gov>
@gina-yamada
Copy link
Contributor Author

Thanks @sheldon-b

@gina-yamada gina-yamada merged commit 6024a8c into main Jun 13, 2023
@gina-yamada gina-yamada deleted the gyamada/fix-verify-info-analytics branch June 13, 2023 21:34
@soniaconnolly soniaconnolly mentioned this pull request Jun 13, 2023
7 tasks
@jmhooper jmhooper mentioned this pull request Jun 15, 2023
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.

4 participants