Skip to content
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

LG-12617: Add additional profile details to IdV analytics logs #10216

Closed
wants to merge 4 commits into from

Conversation

matthinz
Copy link
Member

@matthinz matthinz commented Mar 7, 2024

🎫 Ticket

Link to the relevant ticket:
LG-12617

🛠 Summary of changes

This PR starts augmenting identity verification related analytics events with information about the user's existing profiles:

  • active_profile_idv_level contains the level of identity verification for the user's active profile (if any)
  • pending_profile_idv_level contains the level of identity verification for the user's pending profile (if any)
  • profile_history contains an array with metadata about the user's profiles. This includes various *_at timestamps and other flags. nil values are excluded.

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • Start monitoring your events.log: tail -f log/events.log
  • Go through identity verification and verify that profile_history is added to IdV events
  • Reset your password
  • Go back through identity verification and verify that profile_history on new events includes the user's old profile and, after verification, their new one as well.

matthinz added 4 commits March 7, 2024 09:58
Don't include nil values here
Summarize the history of a user's profiles in IdV analytics events

changelog: Internal, Identity verification, Include profile metadata in analytics logs
@matthinz matthinz requested a review from a team March 7, 2024 23:38
@@ -50,7 +50,28 @@ def self.included(_mod)
def common_analytics_attributes
{
proofing_components: proofing_components,
}
active_profile_idv_level: active_profile&.idv_level,
Copy link
Member

Choose a reason for hiding this comment

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

Should these be in the IdV events enhancer or is there value in logging these on all analytics events?

Comment on lines +55 to +57
profile_history: profile_history,

}.compact
Copy link
Contributor

Choose a reason for hiding this comment

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

style nit: remove this blank line?

Suggested change
profile_history: profile_history,
}.compact
profile_history: profile_history,
}.compact

def profile_history
return [] if !user&.respond_to?(:profiles)
(user&.profiles || []).
sort_by { |profile| profile.created_at }.
Copy link
Contributor

Choose a reason for hiding this comment

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

small suggestion

Suggested change
sort_by { |profile| profile.created_at }.
sort_by(&:created_at)

@matthinz
Copy link
Member Author

matthinz commented Mar 8, 2024

Closing for now -- going to do a little work on AnalyticsEventsEnhancer separately first.

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