Reattempt save as temporary user only when we were previously anon

…but not when we were previously logged-in. Temporary accounts no
longer leak IP addresses, but it's still not nice to lose attribution
of edits by logged-in users.

Follow-up to 317d6dd724.

Bug: T345975
Change-Id: I24c786c0f060921f773e1d6d1c7463f1cc79aab2
This commit is contained in:
Bartosz Dziewoński 2024-08-27 23:23:11 +02:00
parent 24c53a321e
commit b4fc696ad5

View file

@ -777,7 +777,7 @@ ve.init.mw.ArticleTarget.prototype.saveFail = function ( doc, saveData, code, da
this.refreshUser().then( ( username ) => {
// Reattempt the save after successfully refreshing the
// user, but only if it's a temporary account (T345975)
if ( mw.util.isTemporaryUser( username ) ) {
if ( error.code === 'assertanonfailed' && mw.util.isTemporaryUser( username ) ) {
this.startSave( this.getSaveOptions() );
} else {
this.saveErrorNewUser( username );