Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23701] iOS: close() is applied to multiple window views with Storyboard enabled

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-08-01T00:51:17.000+0000
Affected Version/sRelease 5.4.0
Fix Version/sRelease 5.4.0
ComponentsiOS
Labelsqe-5.4.0, regression
ReporterHarry Bryant
AssigneeHans Knöchel
Created2016-07-28T21:30:00.000+0000
Updated2016-08-01T17:58:36.000+0000

Description

*This is a regression from 5.3.1.GA* It was found that when opening a second window within an app, calling the close() method will actually close both windows. *This only occurs when <enable-launch-screen-storyboard> is set to TRUE, which is the default configuration.*

TEST CODE:

Ti.UI.backgroundColor = "Black";

var win = Ti.UI.createWindow({backgroundColor:'blue'});

var open = Ti.UI.createButton({
	title: 'Open Window'	
});

var close = Ti.UI.createButton({
	title: 'Close Window'
});

open.addEventListener('click', function(){
	var win2 = Ti.UI.createWindow({backgroundColor:'green'});
	win2.add(close);
	close.addEventListener('click', function(){
		win2.close();
	});
	win2.open();
});

win.add(open);
win.open();
Background: *Black* {color:#205081}Window 1: *Blue*{color} {color:#14892c}Window 2: *Green*{color}

Steps to Reproduce

1. Create a new Classic Mobile Project. 2. Copy above test code into app.js file. 3. Ensure that <enable-launch-screen-storyboard> is set to TRUE in the tiapp.xml. 4. Run App to device / sim. 5. Click on "Open Window" button, this will open a second green window. 6. Click on "Close Window" button, this will close the second green window.

Actual Result

Both {color:#205081}win1{color} & {color:#14892c}win2{color} are closed, revealing the black background.

Expected Result

Only {color:#14892c}win2{color} should be closed.

Comments

  1. Chee Kiat Ng 2016-07-29

    From Harry: 5.4.0.v20160720201924 was unaffected, So the causing factor would most likely be made somewhere between 20-25th
  2. Hans Knöchel 2016-07-29

    Most probably caused by https://github.com/appcelerator/titanium_mobile/pull/8152, will check right now.
  3. Hans Knöchel 2016-07-29

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/8169 PR (5_4_X): https://github.com/appcelerator/titanium_mobile/pull/8170
  4. Chee Kiat Ng 2016-08-01

    CR and FT passed. PRs merged.
  5. Harry Bryant 2016-08-01

    Verified as fixed, with the latest build this issue is no longer reproducible. However I've found that when opening and closing the window a couple of times, I receive the following DEBUG log:
       [DEBUG] :  Window is not open. Ignoring this close call
       
    Additionally, the log count is incremented every time I cycle through Open / Close. For example after 5 cycles I receive the following:
       [DEBUG] :  Window is not open. Ignoring this close call
       [DEBUG] :  Window is not open. Ignoring this close call
       [DEBUG] :  Window is not open. Ignoring this close call
       [DEBUG] :  Window is not open. Ignoring this close call
       [DEBUG] :  Window is not open. Ignoring this close call
       [DEBUG] :  Window is not open. Ignoring this close call
       [DEBUG] :  Window is not open. Ignoring this close call
       [DEBUG] :  Window is not open. Ignoring this close call
       [DEBUG] :  Window is not open. Ignoring this close call
       [DEBUG] :  Window is not open. Ignoring this close call
       [DEBUG] :  Window is not open. Ignoring this close call
       [DEBUG] :  Window is not open. Ignoring this close call
       [DEBUG] :  Window is not open. Ignoring this close call
       [DEBUG] :  Window is not open. Ignoring this close call
       [DEBUG] :  Window is not open. Ignoring this close call
       
    ( 1 + 2 + 3 + 4 + 5 ) *Closing this ticket as fixed.* A separate ticket has been created in regards to the discovered issue. ( TIMOB-23711 ) Tested On: iPhone 6S (9.3.3) Device Mac OSX El Capitan 10.11.5 Ti SDK: 5.4.0.v20160801022303 Appc Studio: 4.7.0.201607111053 Appc NPM: 4.2.7 App CLI: 5.4.0-37 Xcode 7.3 Node v4.4.7
  6. Hans Knöchel 2016-08-01

    [~htbryant] That is very important to know. Did that not happen prior to 5.4.0? And using what test-case?
  7. Harry Bryant 2016-08-01

    [~hansknoechel] This issue doesn't occur with 5.3.1.GA. I've included the test case and reproducible steps in the created ticket: TIMOB-23711 . Additionally, checked to see if Storyboard set to true was causing the issue, but it occurs even when set to false.

JSON Source