{ "id": "176149", "key": "TIMOB-28418", "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": [ { "id": "21050", "name": "Release 10.0.0", "archived": false, "released": true, "releaseDate": "2021-05-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-04-13T18:47:22.000+0000", "created": "2021-04-12T22:14:10.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "TabGroup", "android", "regression", "tab" ], "versions": [ { "id": "21050", "name": "Release 10.0.0", "archived": false, "released": true, "releaseDate": "2021-05-17" } ], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-04-13T18:47:22.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Summary:*\r\nAs of Titanium 10.0.0, setting a tab property such as \"title\", \"icon\", \"badge\", etc. will cause a crash if set after TabGroup creation and before the TabGroup's open event has been fired.\r\n\r\nThis bug was caught before release.\r\n\r\n*Steps to reproduce:*\r\n# Build and run [^TabGroupChangeBeforeOpenTest.js] on Android.\r\n# Notice it crashes on app startup.\r\n\r\n*Result:*\r\n{code}\r\n[ERROR] TiExceptionHandler: tabGroup.tabs[0].title=\"Tab 1\",\r\n[ERROR] TiExceptionHandler: ^\r\n[ERROR] TiExceptionHandler: Error: Windows are created during open\r\n[ERROR] TiExceptionHandler: at /TabGroupChangeBeforeOpenTest.js:16:23\r\n[ERROR] TiExceptionHandler: at Module._runScript (ti:/kroll.js:1351:15)\r\n[ERROR] TiExceptionHandler: at Module.load (ti:/kroll.js:831:13)\r\n[ERROR] TiExceptionHandler: at Module.loadJavascriptText (ti:/kroll.js:1197:15)\r\n[ERROR] TiExceptionHandler: at Module.loadAsFile (ti:/kroll.js:1249:22)\r\n[ERROR] TiExceptionHandler: at Module.loadAsFileOrDirectory (ti:/kroll.js:1168:26)\r\n[ERROR] TiExceptionHandler: at Module.require (ti:/kroll.js:1037:24)\r\n[ERROR] TiExceptionHandler: at Module.global.Module.require (:5086:32)\r\n[ERROR] TiExceptionHandler: at require (ti:/kroll.js:1315:22)\r\n[ERROR] TiExceptionHandler: at /app.js:293:1\r\n[ERROR] TiExceptionHandler:\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.proxy.TiWindowProxy.createView(TiWindowProxy.java:100)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:467)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:434)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.TabProxy.onPropertyChanged(TabProxy.java:248)\r\n[ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)\r\n[ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:172)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiApplication.launch(TiApplication.java:854)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.loadScript(TiLaunchActivity.java:96)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiRootActivity.loadScript(TiRootActivity.java:497)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.onResume(TiLaunchActivity.java:177)\r\n[ERROR] V8Exception: Exception occurred at /TabGroupChangeBeforeOpenTest.js:16: Uncaught Error: Windows are created during open\r\n{code}\r\n\r\n*Reason:*\r\nOur Java {{TabGroupProxy}} class does not support the {{createView()}}. Calling it will cause the above exception to be thrown via its {{TiWindowProxy}} class here...\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/proxy/TiWindowProxy.java#L100\r\n\r\nThe {{createView()}} method is getting called because our {{TabProxy.onPropertyChanged()}} method calls {{getOrCreateView()}} methods (see link below). I'm not sure why it didn't crash before, but the correct solution is to call {{tabGroupProxy.peekView()}} and if it returns {{null}} then return out.\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/TabProxy.java#L236-L263\r\n\r\n*Work-Around:*\r\nSet all tab properties upon creation or after the \"open\" event has fired.\r\n", "attachment": [ { "id": "67866", "filename": "TabGroupChangeBeforeOpenTest.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-04-12T22:07:51.000+0000", "size": 631, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "Android: Setting tab property after creation and before open causes crash as of 10.0.0", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1222, "state": "closed", "name": "2021 Sprint 8", "startDate": "2021-04-12T21:26:41.532Z", "endDate": "2021-04-23T21:26:00.000Z", "completeDate": "2021-04-28T15:13:56.824Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "458567", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/12717", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-04-13T02:07:39.000+0000", "updated": "2021-04-13T02:07:39.000+0000" }, { "id": "458569", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, waiting on Jenkins build", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-04-13T13:40:13.000+0000", "updated": "2021-04-13T13:40:13.000+0000" }, { "id": "458574", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master and 10_0_X branches for 10.0.0 target", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2021-04-13T18:47:18.000+0000", "updated": "2021-04-13T18:47:18.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }