Page MenuHomePhabricator

mw.api.getToken should not cache HTTP errors
Closed, ResolvedPublic

Description

Temporary HTTP errors should not cached by mw.api.getToken.

Steps to reproduce

  • Load MediaWiki
  • Switch browser to offline mode
  • Enter

var api = new mw.Api();
api.getToken( 'foo' )
.done( function ( data ) {
console.log( 'done', data );
} )
.fail( function ( error ) {
console.log( 'fail', error );
} );

fail http

  • Switch browser to online mode
  • Enter

api.getToken( 'foo' )
.done( function ( data ) {
console.log( 'done', data );
} )
.fail( function ( error ) {
console.log( 'fail', error );
} );

fail fail

expected result

fail token-missing


Version: 1.24rc
Severity: normal

Details

Reference
bz65268

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:24 AM
bzimport set Reference to bz65268.
Fomafix created this task.May 13 2014, 5:28 PM

Change 133106 had a related patch set uploaded by Gerrit Patch Uploader:
mediawiki.api: Do not cache errors in getToken()

https://gerrit.wikimedia.org/r/133106

Change 133106 merged by jenkins-bot:
mediawiki.api: Do not cache errors in getToken()

https://gerrit.wikimedia.org/r/133106