Skip to content

Remove event-specific hooks in Analytics class, move up to calling code#7685

Merged
zachmargolis merged 3 commits intomainfrom
margolis-remove-docauth-events-mixin
Jan 24, 2023
Merged

Remove event-specific hooks in Analytics class, move up to calling code#7685
zachmargolis merged 3 commits intomainfrom
margolis-remove-docauth-events-mixin

Conversation

@zachmargolis
Copy link
Contributor

I realized that we have moved all analytics events to methods (instead of string keys), we could explicitly call this specific side effects at the call sites, instead of guessing where they came from. It leaves us with cleaner code IMO

This should be a no-op in terms of log data

changelog: Internal, Analytics, Move GPO and phone step events to call sites
@zachmargolis zachmargolis requested a review from a team January 23, 2023 21:27

def register_doc_auth_step_from_analytics_event(event, attributes)
return unless user && user.class != AnonymousUser
success = attributes.blank? || attributes[:success] == 'success'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

in hindsight, very strange this code checked that :success == 'success' since I'd expect it to be true|false

Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

LGTM 👍 I was also not a fan of docauth-specific code living in the base analytics class.

Copy link
Contributor

@theabrad theabrad left a comment

Choose a reason for hiding this comment

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

LGTM

end

def register_doc_auth_step_from_analytics_event(event, attributes)
return unless user && user.class != AnonymousUser
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this check for AnonymousUser retained in the replacement code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is not, but it would be extremely surprising if an anonymous (logged out) user was able to make it all the way through IDV, I figured it was not worth carrying over

@zachmargolis zachmargolis merged commit 1af92c5 into main Jan 24, 2023
@zachmargolis zachmargolis deleted the margolis-remove-docauth-events-mixin branch January 24, 2023 18:26
@mdiarra3 mdiarra3 mentioned this pull request Jan 26, 2023
zachmargolis added a commit that referenced this pull request Feb 14, 2023
…lling code (#7685)"

This reverts commit 1af92c5.

changelog: Internal, Reporting, Revert analytics event refactor
zachmargolis added a commit that referenced this pull request Feb 15, 2023
…lling code (#7685)" (#7833)

This reverts commit 1af92c5.

changelog: Internal, Reporting, Revert analytics event refactor
zachmargolis added a commit that referenced this pull request Feb 27, 2023
- Builds on logging added in #7864, and is a redo of #7685 now that
  we have logging to ensure better coverage

- Specs were added in #7864
zachmargolis added a commit that referenced this pull request Feb 28, 2023
- Builds on logging added in #7864, and is a redo of #7685 now that
  we have logging to ensure better coverage

- Specs were added in #7864

changelog: Internal, Logging, Move doc auth logging out of shared analytics class
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