Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2AAEF18127 for ; Wed, 10 Feb 2016 19:20:48 +0000 (UTC) Received: (qmail 67580 invoked by uid 500); 10 Feb 2016 19:20:45 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 67541 invoked by uid 500); 10 Feb 2016 19:20:45 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 67526 invoked by uid 99); 10 Feb 2016 19:20:44 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2016 19:20:44 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id EB11329B5A3; Wed, 10 Feb 2016 19:20:43 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============8863437886934109204==" MIME-Version: 1.0 Subject: Re: Review Request 42367: AMBARI-14574: multiple clicks on "Next" button causes skipping of steps while installing a cluster From: Di Li To: Jaimin Jetly , Alexandr Antonenko , Di Li Cc: Keta Patel , Ambari Date: Wed, 10 Feb 2016 19:20:43 -0000 Message-ID: <20160210192043.24149.87905@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Di Li X-ReviewGroup: Ambari X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/42367/ X-Sender: Di Li X-ReviewBoard-ShipIt: 1 References: <20160122191502.32039.31202@reviews.apache.org> In-Reply-To: <20160122191502.32039.31202@reviews.apache.org> X-ReviewBoard-ShipIt-Only: 1 Reply-To: Di Li X-ReviewRequest-Repository: ambari --===============8863437886934109204== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/42367/#review118712 ----------------------------------------------------------- Ship it! Ship It! - Di Li On Jan. 22, 2016, 7:14 p.m., Keta Patel wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/42367/ > ----------------------------------------------------------- > > (Updated Jan. 22, 2016, 7:14 p.m.) > > > Review request for Ambari, Alexandr Antonenko, Di Li, and Jaimin Jetly. > > > Bugs: AMBARI-14574 > https://issues.apache.org/jira/browse/AMBARI-14574 > > > Repository: ambari > > > Description > ------- > > On installation wizard, multiple clicks on the "Next" button can cause skipping of steps. The timing of the 2nd click decides if that click will be processed again or not. The following JIRAs had the same issue: > AMBARI-7195 > AMBARI-7315 > The fix for the above issues helps to resolve most part of the problem. But if the user happened to click again at the point when the last callback function has just completed (and thus, has made the "Next" button clickable again) but the next step has not yet completed its rendering, then the 2nd click gets processed again. The "current step" was already updated in the code to point to the next step, from the 1st click. So when this 2nd click calls the "next" function in the router, the subsequent step of the "current step" gets set as the current step. As a result we skip steps. > > > Diffs > ----- > > ambari-web/app/controllers/wizard/step0_controller.js 5f134b5 > ambari-web/app/controllers/wizard/step3_controller.js a43303b > ambari-web/app/controllers/wizard/step4_controller.js 17ce7a6 > ambari-web/app/controllers/wizard/step7_controller.js 7b423b6 > ambari-web/app/mixins/wizard/assign_master_components.js 5545e92 > ambari-web/app/router.js 92b2bae > ambari-web/app/routes/installer.js e37a05d > ambari-web/app/views/wizard/step0_view.js 07d3414 > ambari-web/app/views/wizard/step10_view.js 858a4b2 > ambari-web/app/views/wizard/step1_view.js 452e676 > ambari-web/app/views/wizard/step2_view.js 1988f4e > ambari-web/app/views/wizard/step3_view.js 0aa5460 > ambari-web/app/views/wizard/step4_view.js 3def0c5 > ambari-web/app/views/wizard/step5_view.js a3f57b5 > ambari-web/app/views/wizard/step6_view.js e8ae176 > ambari-web/app/views/wizard/step7_view.js 9cea52f > ambari-web/app/views/wizard/step8_view.js c653fdd > ambari-web/app/views/wizard/step9_view.js e58186b > ambari-web/test/controllers/wizard/step0_test.js 4349d04 > ambari-web/test/controllers/wizard/step3_test.js 7b6684f > ambari-web/test/controllers/wizard/step4_test.js 9227279 > ambari-web/test/controllers/wizard/step5_test.js e0f8b71 > ambari-web/test/controllers/wizard/step7_test.js 762cf1f > > Diff: https://reviews.apache.org/r/42367/diff/ > > > Testing > ------- > > CAUSE & FIX: > The issue is seen in most of the wizard installation steps because the properties responsible to disable the duplicate submit calls are unable to account for the transition between the 'actions' and 'render' queues used by the Ember framework. > The installation steps use the 'submit' function from controllers or the 'next' function from installer to set the properties used in the checks for processing the Next button clicks. These properties are reset again in the views of next step if it renders or in the same controller/installer in case of failures. Hence, the property that is responsible for the checks must be accessible across controllers, installer and views. > > The fix proposed for this issue involves creating a new property 'nextBtnClickInProgress' in the router, hence accessible in all the above places. This property is set at suitable places in the controller/installer. It is reset in Views of all the 11 steps of the installation wizard and also at appropriate places in some controllers (resetting for failure cases). > The following steps have been found to skip steps and have been fixed with the required checks: > Step 1 > Step 3 > Step 4 > Step 5 > Step 7 > > TEST CASES: > The test cases check if multiple submit calls succeed in skipping subsequent steps. This is verified by checking the status of router's transitions call after each submit call. Since the router's 'next' function for a step is the last step before the context changes its current step to point to the next step, checking if a router has made this transition or not gives an indication of whether the next step was transitioned or not. > There are 5 new tests added to test this scenario. > > > File Attachments > ---------------- > > AMBARI-14574_Jan20_with_fix.patch > https://reviews.apache.org/media/uploaded/files/2016/01/21/3754e2c0-d245-4ca1-9547-353b59b09ea5__AMBARI-14574_Jan20_with_fix.patch > AMBARI-14574_Jan20_manual_testing.patch > https://reviews.apache.org/media/uploaded/files/2016/01/21/6daf6aa3-dfef-4fbb-8b2d-098faabc56f3__AMBARI-14574_Jan20_manual_testing.patch > AMBARI-14574_Jan22.patch > https://reviews.apache.org/media/uploaded/files/2016/01/22/b40f2a4d-a5c1-45b7-a624-4a80dc7ecaaf__AMBARI-14574_Jan22.patch > > > Thanks, > > Keta Patel > > --===============8863437886934109204==--