Page MenuHomePhabricator

Preference for page-previews default incorrect when resetting preferences
Open, LowPublic

Description

This feature is on by default for new users, but if the user clicks the "Restore all default settings (in all sections)" link, it actually turns the feature off. I don't know if this is intended behaviour but I just noticed it and thought I'd mention it.

https://www.mediawiki.org/wiki/Topic:Upt8og6652ip8lbo

Acceptance criteria

  • If a user selects to restore all default settings, page previews are on (regardless of when the user created their account. )

Event Timeline

TheDJ created this task.Dec 6 2018, 9:34 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 6 2018, 9:34 AM

This will be because (to avoid community members complaining), the preference for Page Previews is off by default (wgPopupsOptInDefaultState) on Wikipedias, and there's a special setting to over-ride that and set it on for new accounts (wgPopupsOptInStateForNewAccounts). Re-setting preferences doesn't trigger the "this is a brand-new account" hook (and rightly-so), so you lose the preference.

In general, re-setting preferences is an extreme action that regular users should not do. Maybe we need to tone up the language about how much it can change their environment?

TheDJ added a comment.Dec 6 2018, 4:05 PM

Can't we somehow flip that logic around ? Seems more sane to me..
Get everyone currently not set to true, with a maintenance script, write them to false, configure default as true...

Can't we somehow flip that logic around ? Seems more sane to me..
Get everyone currently not set to true, with a maintenance script, write them to false, configure default as true...

SRE frown on writing an extra 40m rows to the DB, sadly.

TheDJ added a comment.Dec 7 2018, 7:56 AM

What if we turn wgPopupsOptInStateForNewAccounts into a date value instead ?

Perhaps, though a date comparison is a little slow. We could do what we did for enabling the visual editor – backfill opt-outs for the small number of accounts that have edited in the past year and then change the default. But it's fiddly.

TheDJ added a comment.Dec 7 2018, 11:39 PM

Perhaps, though a date comparison is a little slow

Doesn't matter right ? we only need to check it when resetting the prefs using UserResetAllOptions hook and then override.

pmiazga added a subscriber: pmiazga.EditedDec 11 2018, 10:26 PM

@TheDJ - @Jdforrester-WMF nailed the answer. It's exactly like he says.

Storytime:
First, the Page Previews default mode was "disabled".. Mostly, because some community members were complaining about it.
Then we made it enabled for all anonymous users, but we kept it disabled for logged in users - the old behavior (to keep the community happy). But we found out that this might lead to a bizarre case when the new user creates an account on Wikipedia. As he becomes logged in user, the Page Previews feature would disappear.
Because we couldn't set Page Previews to enabled by default (it would require to update user preferences for all existing accounts to disabled, inserting a new row to user preferences table for each user), we decided to do a nice trick to turn on this feature to all new accounts. On account creation, we set PagePreviews to enabled.

I worked on that feature (enabling for new accounts), and I have to say I missed the UserResetAllOptions hook. It sounds valid to override it to "enabled" when the user resets preferences (as this is the default behavior for anons and all new accounts), but I'm not sure about old accounts (accounts created before we deployed that trick to enable Page Previews).
Thanks for creating this task, we will think what to do with preferences reset.

/cc @ovasileva

ovasileva triaged this task as Normal priority.Jan 7 2019, 5:48 PM
ovasileva updated the task description. (Show Details)

Apologies for not getting to this earlier. Edited task description - agree that previews should be on upon reset (regardless of when a user made their account). Moving to needs analysis.

Personally, I don't think this is worth the trouble and technical debt and would advise declining this task.
I'd much rather we pursued removing the $wgPopupsOptInStateForNewAccounts config variable and making PopupsOptInDefaultState enabled for all logged in users. Per T211305#4803748 we could write a maintenance script to limit the amount of rows added in one single run, but it doesn't seem too much to ask of community members to opt-out explicitly.
We could even do this in the code by checking the value of

mw.user.options.values.popups

and setting it to 0 if undefined...

Jdlrobson renamed this task from Preference for page-previews default incorrect when resetting preferences to [Decline?] Preference for page-previews default incorrect when resetting preferences.Jan 7 2019, 7:53 PM
ovasileva renamed this task from [Decline?] Preference for page-previews default incorrect when resetting preferences to Preference for page-previews default incorrect when resetting preferences.Jan 7 2019, 9:26 PM
ovasileva lowered the priority of this task from Normal to Low.