Skip to content

Split up "Account Reset" analytics event (LG-5910)#6238

Merged
zachmargolis merged 5 commits intomainfrom
margolis-split-up-reset-event
Apr 22, 2022
Merged

Split up "Account Reset" analytics event (LG-5910)#6238
zachmargolis merged 5 commits intomainfrom
margolis-split-up-reset-event

Conversation

@zachmargolis
Copy link
Contributor

@zachmargolis zachmargolis commented Apr 21, 2022

The "Account Reset" event was wearing a lot of hats... it had an event key and was basically combining a bunch of different separate events. There were some fields in common across these, but I think it's easier to reason about if we separate them.

  • cancel
  • delete
  • request
  • cancel token validation
  • granted token valdiation
  • notifications

Bonus: migrated ACCOUNT_RESET_VISIT while I was here

Sub-events that were split out:
- cancel
- delete
- request
- cancel token validation
- granted token valdiation
- notifications
changelog: Internal, Documentation, Document analytics events
# An account reset was cancelled
def account_reset_cancel(user_id:, message_id: nil, request_id: nil, **extra)
track_event(
'Account Reset: cancel',
Copy link
Contributor

Choose a reason for hiding this comment

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

don't we still want these as constants?

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 all the previous PRs, we haven't been keeping the constants, what would we use them for?

Copy link
Contributor

Choose a reason for hiding this comment

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

They get used here and in tests, so I could see the case to have constants. I'm comfortable either way though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, for consistency I'm going to keep this one as is. The bummer is that constants don't get expanded inside YARD Tags so we'd need to find a way to work around that or still have some duplication.

If anybody got a proposal for how we can DRY these and still keep the event documentation working, I'm all ears

Copy link
Contributor

@stevegsa stevegsa left a comment

Choose a reason for hiding this comment

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

LGTM

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

@zachmargolis zachmargolis merged commit 79d3ab0 into main Apr 22, 2022
@zachmargolis zachmargolis deleted the margolis-split-up-reset-event branch April 22, 2022 14:58
@jmdembe jmdembe mentioned this pull request Apr 26, 2022
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