Skip to content

Add additional logging details for partner email selection#11550

Merged
aduth merged 11 commits intomainfrom
aduth-select-email-analytics
Dec 4, 2024
Merged

Add additional logging details for partner email selection#11550
aduth merged 11 commits intomainfrom
aduth-select-email-analytics

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Nov 25, 2024

🛠 Summary of changes

Adds a handful of additional logging details to be able to help monitor usage with the new partner email selection feature:

  • Add property from_select_email_flow (boolean) to 'Add Email: Email Confirmation': Whether email was confirmed after being added as part of partner email selection
  • Add property in_select_email_flow (boolean) to 'Add Email Requested': Whether email is being added as part of partner email selection
  • Add property in_select_email_flow (boolean) to 'Add Email Address Page Visited': Whether email is being added as part of partner email selection
  • Add property selected_email_id (integer) to :sp_select_email_submitted: Submitted ID value for email address record

📜 Testing Plan

Repeat Testing Plan from #10951, and observe logging details above as applicable.

@aduth aduth requested a review from a team November 25, 2024 15:30
Copy link
Contributor

@kevinsmaster5 kevinsmaster5 left a comment

Choose a reason for hiding this comment

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

Looks good. tested locally to confirm expected logging

aduth added 2 commits December 2, 2024 07:13
changelog: Internal, Analytics, Add additional logging details for partner email selection
Not relevant for this flow. Unfortunate consequence of sharing event between initial account creation email confirmation, and subsequent email additions
@aduth aduth force-pushed the aduth-select-email-analytics branch from 61fa990 to f68ea50 Compare December 2, 2024 12:13
aduth and others added 8 commits December 2, 2024 07:25
Avoid in logging result except where used in account email controller
UndocumentedParams checker still flags if passed as nil, avoid passing altogether

Effect on user_id should be non-regressing, since user_id should only supersede default if associated with a user
Required keyword argument on add_email_confirmation, avoid regressing
Since it's shared, and only 1 place needs this in logging result, instead append to logging result from controller
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>

def submit(params)
@selected_email_id = params[:selected_email_id]
@selected_email_id = params[:selected_email_id].try(:to_i)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think try will never fail here. to_i is always safe as far as I'm aware. nil.to_i => 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's some related discussion in Slack about this change: https://gsa-tts.slack.com/archives/C0NGESUN5/p1733256901533489

Where specifically it stems from an observation that not all parameter types are safe to to_i, e.g. true

> true.to_i
(irb):1:in `<main>': undefined method `to_i' for true (NoMethodError)

Avoid logging 0 ID for empty value
@aduth aduth merged commit 6673030 into main Dec 4, 2024
@aduth aduth deleted the aduth-select-email-analytics branch December 4, 2024 12:26
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