CommentController: Remove remains of client-side edit conflict handling

In commit 8829a1a412 we kept this code
when adding the reply API, but on second thought it doesn't actually
make sense.

The reply API should never fail with an edit conflict normally, since
it makes the edit on the latest version of the page. If it does fail,
I think it's better to just show the error message. Current behavior
is to retry, and if that doesn't actually solve the problem, this ends
up in an infinite loop.

Bug: T252558
Change-Id: I5e0dcb2c42e5de4f18e99b8a761ca048a430b31e
This commit is contained in:
Bartosz Dziewoński 2020-08-10 20:15:20 +02:00
parent 9e7287d233
commit 2d038af705

View file

@ -299,10 +299,6 @@ CommentController.prototype.save = function ( comment, pageName ) {
api: new mw.Api( { ajax: { timeout: 0 }, parameters: { formatversion: 2 } } )
}
).catch( function ( code, data ) {
// Try again if there's an edit conflict. The latest revision will be fetched on the server.
if ( code === 'editconflict' ) {
return commentController.save( comment, pageName );
}
// Better user-facing error message
if ( code === 'discussiontools-commentid-notfound' ) {
return $.Deferred().reject( 'discussiontools-commentid-notfound', { errors: [ {