Skip to content

LG-6317 - Retire registration_logs#7107

Merged
zachmargolis merged 9 commits intomainfrom
stevegsa-retire-reg-logs
Oct 12, 2022
Merged

LG-6317 - Retire registration_logs#7107
zachmargolis merged 9 commits intomainfrom
stevegsa-retire-reg-logs

Conversation

@stevegsa
Copy link
Contributor

@stevegsa stevegsa commented Oct 7, 2022

🎫 Ticket

LG-6317

🛠 Summary of changes

registration_logs was originally created as a way to track the registration funnel. (ie how long on average does it take for a user to complete registration?) With this addition #6194 the funnel can now be tracked completely in the analytics. However registration_logs also gives us a way to calculate fully registered users, that is users that have completed entering a password and successfully adding an mfa. Historically 2 mfas were required and that restriction was lifted and now the moment they successfully configure an mfa they are considered fully registered.

The full registered user counts are required by several reports including one that restricts the count to a certain range. Therefore an indexed registered_at time is still needed. However all the fields in registration_logs other than user_id can now be removed. We could put registered_at on the users table but this would not only be a drain on the table when migrating over but would also add more indexes to users which is not recommended. The decoupled 1:1 solution is superior and since the registered_at field will never be null (can be enforced in subsequent prs and data migration to remove rows not fully registered) a simple count of all the records can be done to get the fully registered count including fast semi-realtime methods of getting table counts/estimates can be utilized in addition to using just the index to calculate the size.

The registration_logs will look like this after a subsequent culling pr:

  create_table "registration_logs", force: :cascade do |t|
    t.integer "user_id", null: false
    t.datetime "registered_at", precision: nil
    t.index ["registered_at"], name: "index_registration_logs_on_registered_at"
    t.index ["user_id"], name: "index_registration_logs_on_user_id", unique: true
  end

currently testing if the fully registered counts can be entirely calculated from the mfa configurations tables.
Update - we can't because the user can delete an mfa and we used destroy (rather than disable) so the new registered_at will be the new mfa's addition time.

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • Step 1
  • Step 2
  • Step 3

👀 Screenshots

If relevant, include a screenshot or screen capture of the changes.

Before:
After:

🚀 Notes for Deployment

Include any special instructions for deployment.

@stevegsa stevegsa marked this pull request as ready for review October 7, 2022 19:15
@stevegsa stevegsa requested review from a team and zachmargolis October 7, 2022 19:16
Copy link
Contributor

@zachmargolis zachmargolis 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 dd188d7 into main Oct 12, 2022
@zachmargolis zachmargolis deleted the stevegsa-retire-reg-logs branch October 12, 2022 17:18
jskinne3 pushed a commit that referenced this pull request Oct 12, 2022
* changelog: Internal, Analytics, Only populate registration_logs for final step
@jmdembe jmdembe mentioned this pull request Oct 13, 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.

2 participants