From 6bd5142f2a8ecbc160bcad2588b9e73584deecf4 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 26 Mar 2015 16:06:43 -0700 Subject: [PATCH] When content and metadata have different revids, explicitly retry the higher one It's much less likely we'll get another conflict if we retry with ?oldid=12345 than if we retry omitting the oldid again. Change-Id: I10e40f714fd44d7f0ac16c9d0dc6239a95c0ec51 --- modules/ve-mw/init/ve.init.mw.Target.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/ve-mw/init/ve.init.mw.Target.js b/modules/ve-mw/init/ve.init.mw.Target.js index 99d2cc52fe..07a67e469b 100644 --- a/modules/ve-mw/init/ve.init.mw.Target.js +++ b/modules/ve-mw/init/ve.init.mw.Target.js @@ -354,8 +354,13 @@ ve.init.mw.Target.onLoad = function ( response ) { ); } else { this.retriedRevIdConflict = true; - // Have to retry both until we can access the document server directly... + // TODO this retries both requests, in RESTbase mode we should only retry + // the request that gave us the lower revid this.loading = false; + // HACK: Load with explicit revid to hopefully prevent this from happening again + if ( !this.requestedRevId ) { + this.requestedRevId = Math.max( docRevId, this.revid ); + } this.load(); } return;