Page MenuHomePhabricator

Stop inserting new Echo user_properties rows in the onLocalUserCreated hook
Open, Needs TriagePublic

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.