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

Fix unconfirmed accounts being registered as active users #23803

Merged
merged 2 commits into from Mar 6, 2023

Conversation

ClearlyClaire
Copy link
Contributor

@ClearlyClaire ClearlyClaire commented Feb 22, 2023

The total user count is the total of users who have confirmed their email address, but the active user count also includes users who have not.

Note that confirmed but not-approved users remain part of the total user count and may be considered as active as well. Maybe we should change that too.

Copy link
Member

@Gargron Gargron left a comment

Choose a reason for hiding this comment

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

Maybe it would make sense to rename these methods to after_sign_up! and after_sign_in!?

UserMailer.welcome(self).deliver_later
TriggerWebhookWorker.perform_async('account.approved', 'Account', account_id)
end

def prepare_returning_user!
ActivityTracker.record('activity:logins', id)
ActivityTracker.record('activity:logins', id) if confirmed?
Copy link
Member

Choose a reason for hiding this comment

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

We don't need to execute this entire method if neither confirmed? nor approved? are true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed it for a guard clause, but I'm uncomfortable with changing the behavior further wrt. approved?.

@ClearlyClaire ClearlyClaire force-pushed the fixes/unconfirmed-active-users branch from ff81470 to 9d8b656 Compare March 6, 2023 13:46
@Gargron Gargron merged commit 86f8aa2 into mastodon:main Mar 6, 2023
11 checks passed
ClearlyClaire added a commit to ClearlyClaire/mastodon that referenced this pull request Mar 14, 2023
noellabo pushed a commit to fedibird/mastodon that referenced this pull request Mar 17, 2023
rutvijmehta-harness pushed a commit to rutvijmehta-harness/mastodon that referenced this pull request Mar 19, 2023
rutvijmehta-harness added a commit to rutvijmehta-harness/mastodon that referenced this pull request Mar 19, 2023
…3803) (#20)

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
arachnist pushed a commit to arachnist/mastodon that referenced this pull request Apr 4, 2023
Roboron3042 pushed a commit to Roboron3042/mastodon that referenced this pull request Apr 16, 2023
noellabo pushed a commit to fedibird/mastodon that referenced this pull request Apr 22, 2023
skerit pushed a commit to 11ways/mastodon that referenced this pull request Jul 7, 2023
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.

None yet

2 participants