Fix callback group implementation to match the documentation.
The contract for a CallbackGroup is that all callbacks are invoked exactly once (either success or failure). + Failures are invoked immediately + Success wait until all callbacks are complete In certain situations, like caches, callbacks may be invoked immediately if the result is known. Depending on how the other callbacks completed, this could have caused the callback to be invoked more than once; once for success and again for the subsequently added callback success or failure. Change-Id: If4c5d99bff6dc916826572ddb6fdff914536a01d
This commit is contained in:
@@ -288,7 +288,7 @@ public class ChangeScreen extends Screen
|
||||
// Handled by last callback's onFailure.
|
||||
}
|
||||
}));
|
||||
ChangeApi.detail(event.getValue().getChange().getId().get(), cbs.add(
|
||||
ChangeApi.detail(event.getValue().getChange().getId().get(), cbs.addFinal(
|
||||
new GerritCallback<com.google.gerrit.client.changes.ChangeInfo>() {
|
||||
@Override
|
||||
public void onSuccess(
|
||||
|
Reference in New Issue
Block a user