https://bugzilla.wikimedia.org/show_bug.cgi?id=47348

--- Comment #3 from kipod <[email protected]> ---
no problem.

please note that the issue is intermittent, and i was not able so far to find
any clues when does it happen.

so here is the "full" test. this script will create a new link in the toolbox
to try and get patrol token.
pressing this button repeatedly by a user in hewiki with "patroller" rights
produces intermittent  successes and failures.

in order to get meaningful results, the logged-in user must have "patroller"
rights, otherwise failure to obtain the token is the expected behavior.



peace.


8< ---------------------------------------------------
$(mw.util.addPortletLink('p-tb', '#', 'Test API token
problem')).click(function(e) {
    e.preventDefault()
    mw.loader.using('mediawiki.api', function() {
        var api = new mw.Api();
        api.get({list: 'recentchanges', rclimit: 1, rctoken: 'patrol'},
            function(data) { // success
                var token = data && data.query && data.query.recentchanges &&
data.query.recentchanges[0].patroltoken;
                if (token)
                    alert('received token: "' + token + '"');
                else {
                    var warning = data && data.warnings &&
data.warnings.recentchanges && data.warnings.recentchanges['*']
                    alert('No token received. ' + (warning ? 'Warning: "' +
warning + '"' : '') )
                } // else
            },
            function() { // failure
                alert('Api call failed');
            }
        ); // api.get
    }); // using 
}); // click

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to