ArticleTarget: Remove unused retrying support

This has not been used for many, many years, since we started using
mw.Api#postWithToken, which automatically retries on 'badtoken' errors.
Most of our code for it was removed (e.g. save() is never called
with three parameters), but some comments and parameters remained.

Change-Id: Ibca2a222f808e6e2796ed6a61e9587a646afcf31
This commit is contained in:
Bartosz Dziewoński 2023-08-14 18:51:25 +02:00
parent 46f661ac66
commit 4bb8d8f8ea
2 changed files with 4 additions and 9 deletions

View file

@ -733,17 +733,13 @@ ve.init.mw.ArticleTarget.prototype.saveComplete = function ( data ) {
/**
* Handle an unsuccessful save request.
*
* TODO: This code should be mostly moved to ArticleTargetSaver,
* in particular the badtoken error handling.
*
* @param {HTMLDocument} doc HTML document we tried to save
* @param {Object} saveData Options that were used
* @param {boolean} wasRetry Whether this was a retry after a 'badtoken' error
* @param {string} code Error code
* @param {Object|null} data Full API response data, or XHR error details
* @fires saveError
*/
ve.init.mw.ArticleTarget.prototype.saveFail = function ( doc, saveData, wasRetry, code, data ) {
ve.init.mw.ArticleTarget.prototype.saveFail = function ( doc, saveData, code, data ) {
var saveErrorHandlerFactory = ve.init.mw.saveErrorHandlerFactory,
handled = false,
target = this;
@ -1517,10 +1513,9 @@ ve.init.mw.ArticleTarget.prototype.getSaveOptions = function () {
* - {string} summary Edit summary
* - {boolean} minor Edit is a minor edit
* - {boolean} watch Watch the page
* @param {boolean} [isRetry=false] Whether this is a retry after a 'badtoken' error
* @return {jQuery.Promise} Save promise, see mw.libs.ve.targetSaver.postHtml
*/
ve.init.mw.ArticleTarget.prototype.save = function ( doc, options, isRetry ) {
ve.init.mw.ArticleTarget.prototype.save = function ( doc, options ) {
var target = this;
// Prevent duplicate requests
@ -1582,7 +1577,7 @@ ve.init.mw.ArticleTarget.prototype.save = function ( doc, options, isRetry ) {
var promise = this.saving = this.tryWithPreparedCacheKey( doc, data, 'save' )
.done( this.saveComplete.bind( this ) )
.fail( this.saveFail.bind( this, doc, data, !!isRetry ) )
.fail( this.saveFail.bind( this, doc, data ) )
.always( function () {
target.saving = null;
} );

View file

@ -421,7 +421,7 @@ ve.init.mw.MobileArticleTarget.prototype.saveComplete = function ( data ) {
/**
* @inheritdoc
*/
ve.init.mw.MobileArticleTarget.prototype.saveFail = function ( doc, saveData, wasRetry, code, data ) {
ve.init.mw.MobileArticleTarget.prototype.saveFail = function ( doc, saveData, code, data ) {
// parent method
ve.init.mw.MobileArticleTarget.super.prototype.saveFail.apply( this, arguments );