Page MenuHomePhabricator

Handle preferences for new users using "ConditionalUserOptions" config instead of "LocalUserCreated" hook inserting preference rows
Closed, ResolvedPublic

Description

DiscussionTools adds new user_properties rows in onLocalUserCreated, to enable the DiscussionTools Echo notifications (echo-subscriptions-email-dt-subscription is the preference) for new users, while keeping it disabled for existing users. Using this approach is wasteful to DB space, and it contributes towards T54777: user_properties table bloat. As a solution for the same problem in Echo itself, conditional user defaults were introduced.

Instead of inserting new rows from the onLocalUserCreated hook, please use conditional defaults instead. See T353225 and https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Echo/+/999086 for the changes in Echo itself.

After deploying the change, the user_properties rows will be deletable. See T357072: Echo: Drop droppable rows from user_properties for a deletion task I created for the Echo-maintained properties.

Event Timeline

Urbanecm_WMF renamed this task from Stop inserting new user_properties rows in onLocalUserCreated to Stop inserting new Echo user_properties rows in the onLocalUserCreated hook.Feb 10 2024, 11:50 PM

Note that PreferenceHooks::onLocalUserCreated in DiscussionTools currently inserts discussiontools-autotopicsub user property as well. It would be great to cover that one as well.

matmarex renamed this task from Stop inserting new Echo user_properties rows in the onLocalUserCreated hook to Handle preferences for new users using "ConditionalUserOptions" config instead of "LocalUserCreated" hook inserting preference rows.May 11 2024, 1:35 PM

Change #1030532 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[operations/mediawiki-config@master] Use ConditionalUserOptions for "echo-subscriptions-email-dt-subscription"

https://gerrit.wikimedia.org/r/1030532

Change #1030533 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Use ConditionalUserOptions for "echo-subscriptions-email-dt-subscription"

https://gerrit.wikimedia.org/r/1030533

Change #1030535 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[operations/mediawiki-config@master] Use ConditionalUserOptions for "discussiontools-autotopicsub"

https://gerrit.wikimedia.org/r/1030535

Change #1030536 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Remove WMF-specific "discussiontools-autotopicsub" settings

https://gerrit.wikimedia.org/r/1030536

Change #1030532 merged by jenkins-bot:

[operations/mediawiki-config@master] Use ConditionalUserOptions for "echo-subscriptions-email-dt-subscription"

https://gerrit.wikimedia.org/r/1030532

Change #1030535 merged by jenkins-bot:

[operations/mediawiki-config@master] Use ConditionalUserOptions for "discussiontools-autotopicsub"

https://gerrit.wikimedia.org/r/1030535

Mentioned in SAL (#wikimedia-operations) [2024-05-14T13:04:43Z] <logmsgbot> lucaswerkmeister-wmde@deploy1002 Started scap: Backport for [[gerrit:1030532|Use ConditionalUserOptions for "echo-subscriptions-email-dt-subscription" (T357221)]], [[gerrit:1030535|Use ConditionalUserOptions for "discussiontools-autotopicsub" (T357221)]]

Mentioned in SAL (#wikimedia-operations) [2024-05-14T13:07:17Z] <logmsgbot> lucaswerkmeister-wmde@deploy1002 matmarex and lucaswerkmeister-wmde: Backport for [[gerrit:1030532|Use ConditionalUserOptions for "echo-subscriptions-email-dt-subscription" (T357221)]], [[gerrit:1030535|Use ConditionalUserOptions for "discussiontools-autotopicsub" (T357221)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-05-14T13:22:43Z] <logmsgbot> lucaswerkmeister-wmde@deploy1002 Finished scap: Backport for [[gerrit:1030532|Use ConditionalUserOptions for "echo-subscriptions-email-dt-subscription" (T357221)]], [[gerrit:1030535|Use ConditionalUserOptions for "discussiontools-autotopicsub" (T357221)]] (duration: 17m 59s)

With these changes deployed, we should no longer be generating new rows on WMF wikis. I'll let the Editing team review the DiscussionTools changes to remove the remaining no-op code at their leisure.

Change #1030533 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Use ConditionalUserOptions for "echo-subscriptions-email-dt-subscription"

https://gerrit.wikimedia.org/r/1030533

Change #1030536 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Remove WMF-specific "discussiontools-autotopicsub" settings

https://gerrit.wikimedia.org/r/1030536