If the user selects to 'Try Content Translation' from the campaign, the dashboard is displayed. However, the beta-feature does not stay enabled and if the user visits Special:CX then they are shown the 'no such page' error.
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | None | T76456 Language Engineering tracker of trackers (tracking) | |||
Open | None | T76448 [Epic] ContentTranslation - Entry Points | |||
Open | None | T87867 Experiment ways to get more users to translate articles (tracking) | |||
Resolved | Pginer-WMF | T90532 Ask users to try the beta feature (tracking) | |||
Resolved | santhosh | T89701 Ask users to try the ContentTranslation beta feature when creating an article | |||
Resolved | KartikMistry | T90876 Enable Content Translation new article campaign (beta feature invitation) on cawiki | |||
Resolved | santhosh | T90529 Measure the effectiveness of editor invitations | |||
Resolved | Arrbee | T90722 Cross-browser testing for beta feature invitation | |||
Resolved | Nikerabbit | T92232 CX beta-feature does not stay enabled |
Event Timeline
Works on my local wiki. When the dashboard opens, do you see "CX beta feature was enabled on this wiki" popup near the personal toolbar?
Can you give an url to the wiki where you see this problem?
Can you give an url to the wiki where you see this problem?
http://en.wikipedia.beta.wmflabs.org/w/index.php?title=Special:ContentTranslation for sure. @santhosh has also been having the same difference in result between local instance and beta-labs. I am beginning to wonder if there is a different configuration on that wiki thats getting in the way here.
Confirmed. After enabling Beta feature via Campaign, it doesn't reflect in DB too.
mysql> select user_id from user where user_name = 'KartikMistry'; +---------+ | user_id | +---------+ | 973 | +---------+ 1 row in set (0.00 sec) mysql> select * from enwiki.user_properties where up_property = 'cx' AND up_user = '973'; +---------+-------------+----------+ | up_user | up_property | up_value | +---------+-------------+----------+ | 973 | cx | 0 | +---------+-------------+----------+ 1 row in set (0.00 sec)
In my testing, cx will be set to 1 when I arrive on Special:CX, however when I load Special:Preferences it is reverted back to 0 in the database.
Heavily summarized binlog output:
## Me loading Special:CX with a campaign, it calls saveSettings() #150318 9:47:09 UPDATE /* User::saveSettings Nikerabbit */ `user` SET user_name = 'Nikerabbit',[XXX] WHERE user_id = '3609' ## saveSettings calls saveOptions, but that deletes the property instead of setting it to 1? #150318 9:47:09 DELETE /* User::saveOptions Nikerabbit */ FROM `user_properties` WHERE up_user = '3609' AND up_property = 'cx' ## saveSettings then reinserts the option with bunch of other stuff #150318 9:47:09 INSERT /* User::saveOptions Nikerabbit */ IGNORE INTO `user_properties` (up_user,up_property,up_value) VALUES ('3609','visualeditor-enable','1'),('3609','visualeditor-hidebetawelcome','1'),('3609','betafeatures-popup-disable','1'),('3609','betafeatures-vector-compact-personal-bar','1'),('3609','betafeatures-vector-fixedheader','0'),('3609','cx','1'),('3609','popups','0'),('3609','timecorrection','Offset|0'),('3609','uls-compact-links','0'),('3609','watchlisttoken','fa8d459584a81afc603ce2a9d58d970bffc1e57a'),('3609','wikibase-otherprojects','0') COMMIT ## me loading Special:Preferences, basically same as above but cx is set to 0 in last INSERT #150318 9:47:15 UPDATE /* User::saveSettings Nikerabbit */ `user` SET user_name = 'Nikerabbit',[XXX] WHERE user_id = '3609' #150318 9:47:15 DELETE /* User::saveOptions Nikerabbit */ FROM `user_properties` WHERE up_user = '3609' AND up_property = 'cx' #150318 9:47:15 INSERT /* User::saveOptions Nikerabbit */ IGNORE INTO `user_properties` (up_user,up_property,up_value) VALUES ('3609','visualeditor-enable','1'),('3609','visualeditor-hidebetawelcome','1'),('3609','betafeatures-popup-disable','1'),('3609','betafeatures-vector-compact-personal-bar','1'),('3609','betafeatures-vector-fixedheader','0'),('3609','cx','0'),('3609','popups','0'),('3609','timecorrection','Offset|0'),('3609','uls-compact-links','0'),('3609','watchlisttoken','fa8d459584a81afc603ce2a9d58d970bffc1e57a'),('3609','wikibase-otherprojects','0') COMMIT
First I thought it would be related to $wgDefaultUserOptions and things missing form it getting deleted, but I don't think that is the case. It looks like something is explicitly setting cx = 0 OR loading a stale value and then calling saveSettings() when accessing Special:Preferences
On my local wiki User::saveOptions is accessed each time Special:Preferences is accessed (also when not changing anything) by BetaFeatures: SpecialPreferences::execute/Preferences::getFormObject/Preferences::getPreferences/Hooks::run/call_user_func_array/BetaFeaturesHooks::getPreferences/User::saveSettings
BetaFeaturesHooks::getPreferences only ever calls setOption with value '1', so it cannot set anything back to '0'. This and the fact that it does not happen on my local wiki leads me to a conclusion that stale data is loaded and then saved.
This is still a problem. Even if I enable CX from the campaign it doesn't get activated for a little while and causes confusion by displaying the beta-feature as initially disabled and then automatically enabled.
Steps to reproduce:
- Check CX is disabled
- Try creating a new page and confirm the campaign is visible
- Click on campaign blue button to enable CX
- From Special:CX click on Preferences or beta link and check the status of CX. It shows 'disabled'
- Special:CX will show 'no such page'
- Reload Special:Preferences and check the status of CX. It shows 'enabled' without any intermediate action from the user
- Special:CX is visible
User::saveSettings() should be invalidating the memcache cache of information via a call to User::clearSharedCache(). Once that is done, the next request that touches the User object should fetch from the database and repopulate memcache. If the requests are close enough together there may be a race with master->slave database replication that allows the older information to be fetched from the slave before it receives the update from the master.
Change 198760 had a related patch set uploaded (by Nikerabbit):
Re-populate shared cached after saving settings
Change 199554 had a related patch set uploaded (by Aaron Schulz):
Made user preferences load from the master
Change 199554 merged by jenkins-bot:
Made user preferences load from the master by default
Based on our testing on deployment-prep this issue has been fixed. We will test on production as well once the patches are there.
Change 198760 abandoned by Aaron Schulz:
Re-populate shared cache after saving settings
Reason:
AFAIK no, closing
Change 201131 had a related patch set uploaded (by KartikMistry):
Made user preferences load from the master by default
Change 201131 merged by jenkins-bot:
Made user preferences load from the master by default
Is it known what is calling saveSettings() to do nothing just be visiting Special:Preferences?