{ "id": "141449", "key": "TIMOB-18186", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2016-10-18T12:49:22.000+0000", "created": "2014-12-11T05:57:15.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "qe-3.5.0" ], "versions": [ { "id": "16704", "description": "Release 3.5.0", "name": "Release 3.5.0", "archived": false, "released": true, "releaseDate": "2015-01-13" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-03-24T17:59:17.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h6. This is not a regression since same scenario occurs in 3.4.1 GA\r\n\r\nTitanium app is crashing when we add same tab more than once in a TabGroup. \r\nConsole logs and Crash logs are attached here.\r\n\r\nh5. Steps To Reproduce\r\n1. Create a classic app using following code\r\n{code}\r\nTitanium.UI.setBackgroundColor('#000');\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\nvar win = Titanium.UI.createWindow({\r\n\ttitle : 'Tab',\r\n\tbackgroundColor : '#fff'\r\n});\r\nvar tab = Titanium.UI.createTab({\r\n\ticon : 'KS_nav_ui.png',\r\n\ttitle : 'Tab',\r\n\twindow : win\r\n});\r\n \r\nvar button = Titanium.UI.createButton({\r\n\ttop : 10,\r\n\ttitle : 'Add tab1'\r\n});\r\nbutton.addEventListener('click', function(e) {\r\n\ttabGroup.addTab(tab1);\r\n});\r\nwin.add(button);\r\n\r\n// create tab1 and win1\r\nvar win1 = Titanium.UI.createWindow({\r\n\ttitle : 'Tab 1',\r\n\tbackgroundColor : '#fff'\r\n});\r\nvar tab1 = Titanium.UI.createTab({\r\n\ticon : 'KS_nav_ui.png',\r\n\ttitle : 'Tab 1',\r\n\twindow : win1\r\n});\r\n\r\ntabGroup.addTab(tab);\r\ntabGroup.open();\r\n{code}\r\n\r\n2. Run on iOS device\r\n3. Click the *Add tab1* button ( It will add a new tab with name *Tab 1* )\r\n4. Click the button many times until you get *More...* tab\r\n5. Click on the *More...* tab\r\n\r\nh5. Actual Result\r\nApp is crashing when *More* tab is clicked.\r\n\r\nh5. Expected Result\r\nApp should not crash. We should handle this gracefully. \r\n\r\nNote: It can either prevent adding same tab again or allowing them with renaming the properties.", "attachment": [ { "id": "53157", "filename": "Console.log", "author": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2014-12-11T05:57:15.000+0000", "size": 4120, "mimeType": "text/plain" }, { "id": "53156", "filename": "CrashLog 12-11-14, 1-41 PM.crash", "author": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2014-12-11T05:57:15.000+0000", "size": 44142, "mimeType": "application/octet-stream" } ], "flagged": false, "summary": "iOS: App is crashing when adding the same tab many times", "creator": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "subtasks": [], "reporter": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "environment": "Titanium SDK: 3.5.0.v20141210202514\r\nAppc-Studio: 3.4.1 GA\r\nTitanium CLI: 3.4.1 GA\r\nAlloy : 1.5.1 GA\r\nXcode : 6.1\r\nOS: OSX 10.10.1\r\nDevice : iPhone 6plus (iOS 8.1)", "comment": { "comments": [ { "id": "336005", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "My preference is that the application spit out an error and only add the tab once.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-12-11T15:48:55.000+0000", "updated": "2014-12-11T15:48:55.000+0000" }, { "id": "399230", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This issue is invalid. The demo-code used a circular memory reference that caused the tabs to be referenced outside a scope. The correct use-case would generate and add the tabs as soon the the button is clicked. I made an iterative example that uses a counter to create n tabs. The \"More\" tab can be clicked without crashes and everything works as expected:\r\n{code:javascript}\r\nTitanium.UI.setBackgroundColor('#000');\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\nvar index = 1;\r\n\r\nvar win = Titanium.UI.createWindow({\r\n title: 'Tab ' + index,\r\n backgroundColor: '#fff'\r\n});\r\nvar tab = Titanium.UI.createTab({\r\n icon: 'KS_nav_ui.png',\r\n title: 'Tab ' + index,\r\n window: win\r\n});\r\n\r\nvar button = Titanium.UI.createButton({\r\n top: 10,\r\n width: Ti.UI.FILL,\r\n title: 'Add tab ' + (index + 1)\r\n});\r\n\r\nbutton.addEventListener('click', function(e) {\r\n index++;\r\n button.setTitle('Add tab ' + (index + 1));\r\n\r\n // create tab1 and win1\r\n var win1 = Titanium.UI.createWindow({\r\n title: 'Tab ' + index,\r\n backgroundColor: '#fff'\r\n });\r\n var tab1 = Titanium.UI.createTab({\r\n icon: 'KS_nav_ui.png',\r\n title: 'Tab ' + index,\r\n window: win1\r\n });\r\n\r\n tabGroup.addTab(tab1);\r\n});\r\n\r\nwin.add(button);\r\n\r\ntabGroup.addTab(tab);\r\ntabGroup.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-18T12:49:22.000+0000", "updated": "2016-10-18T12:49:22.000+0000" }, { "id": "415603", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T17:59:17.000+0000", "updated": "2017-03-24T17:59:17.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }