Last modified: 2014-03-01 16:38:38 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T38138, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 36138 - mw.user.bucket does not re-bucket when a cookie is present and the version number has increased
mw.user.bucket does not re-bucket when a cookie is present and the version nu...
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.19
All All
: Lowest normal (vote)
: 1.23.0 release
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-20 22:43 UTC by Reha Sterbin
Modified: 2014-03-01 16:38 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Reha Sterbin 2012-04-20 22:43:11 UTC
After updating the bucketing configuration (and bumping up the version number), users are not re-bucketed.

REPRODUCE:

Assuming a config like so:

array(
    'buckets' => array(
        'zero' => 50,
        'one' => 50,
    ),
    'version' => 1,
);

After initial bucketing, you'll see a cookie (I used the web developer toolbar) like so:

Name	mediaWiki.user.bucket:mykey
Value	1%3Azero

And "zero" would be returned.

If you then:

1) Update the version in the config from 1 to 2
2) Reload the page (and confirm that you have the new config, of course)
3) Attempt mw.user.bucket

It will still return "zero", and the cookie will still have the value "1%3Azero".

EXPECTED:

A cookie like so, indicating re-bucketing:

Name	mediaWiki.user.bucket:mykey
Value	2%3Azero

WORKAROUND:

You can pass the version as part of the key:

mw.user.bucket( 'mykey@' + cfg.version, cfg )

Which will result in a cookie like this:

Name	mediaWiki.user.bucket:mykey@2
Value	2%3Azero

And will re-bucket when you change the version.

FIX:

https://svn.wikimedia.org/viewvc/mediawiki/branches/wmf/1.19wmf1/resources/mediawiki/mediawiki.user.js?view=markup

~ line 140, check the version from the cookie against the version in the config, and set bucket to null if they don't match.  The check on line 141 will then pass and re-bucketing will occur.
Comment 1 Bartosz Dziewoński 2014-03-01 16:38:38 UTC
mw.user.bucket has been deprecated in I5a66e1a4 and will not be worked on (unless you submit a patch). Sorry.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links