From 3bb4767be7151ce75e40e18b52a59352e4821c37 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Thu, 19 Feb 2015 10:34:56 -0800 Subject: [PATCH] ChangeScreen: Avoid race condition for revision changes loadConfigInfo called renderChangeInfo which called renderRevisionInfo with an empty argument list to initialise the the revision action buttons. The call to renderChangeInfo however was done via a callback, such that we are not sure how long it takes until renderChangeInfo is called. By moving loadRevisionInfo which load the actual revision action info into that callback we can be sure to not have a race of the callback for the callchain as described above and the callback in loadRevisionInfo to render the correct revision info. This will add one round trip time, however it actually fixes a bug. Bug: issue 3192 Change-Id: I186ca5306a29e785981c809c92d51f7a0fb3e71a --- .../java/com/google/gerrit/client/change/ChangeScreen.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.java index 98220dabb4..bae181c647 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.java @@ -240,10 +240,7 @@ public class ChangeScreen extends Screen { @Override public void onSuccess(ChangeInfo info) { info.init(); - // Revision loading may be slower than the rest, so do it - // asynchronous to have the rest fast. loadConfigInfo(info, base); - loadRevisionInfo(); } })); } @@ -817,6 +814,7 @@ public class ChangeScreen extends Screen { commentLinkProcessor = result.getCommentLinkProcessor(); setTheme(result.getTheme()); renderChangeInfo(info); + loadRevisionInfo(); } })); }