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 28457185AA for ; Fri, 22 Jan 2016 19:15:04 +0000 (UTC) Received: (qmail 76481 invoked by uid 500); 22 Jan 2016 19:15:04 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 76453 invoked by uid 500); 22 Jan 2016 19:15:04 -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 76436 invoked by uid 99); 22 Jan 2016 19:15:03 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jan 2016 19:15:03 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 3388828303C; Fri, 22 Jan 2016 19:15:02 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============9051859750766995629==" 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: "Keta Patel" To: "Di Li" , "Alexandr Antonenko" , "Jaimin Jetly" Cc: "Keta Patel" , "Ambari" Date: Fri, 22 Jan 2016 19:15:02 -0000 Message-ID: <20160122191502.32039.31202@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Keta Patel" X-ReviewGroup: Ambari X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/42367/ X-Sender: "Keta Patel" References: <20160121144538.32038.98922@reviews.apache.org> In-Reply-To: <20160121144538.32038.98922@reviews.apache.org> Reply-To: "Keta Patel" X-ReviewRequest-Repository: ambari --===============9051859750766995629== 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/ ----------------------------------------------------------- (Updated Jan. 22, 2016, 7:14 p.m.) Review request for Ambari, Alexandr Antonenko, Di Li, and Jaimin Jetly. Changes ------- The new patch "AMBARI-14574_Jan22.patch" has corrections for some failed test cases. 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 (updated) ---------------- 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 --===============9051859750766995629==--