{ "id": "175027", "key": "TIMOB-27904", "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": "21039", "name": "Release 9.0.3", "archived": false, "released": true, "releaseDate": "2020-06-10" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-06-08T14:05:41.000+0000", "created": "2020-05-21T20:24:46.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "bootstrap", "build", "incremental", "regression" ], "versions": [ { "id": "20412", "name": "Release 8.1.0", "archived": false, "released": true, "releaseDate": "2019-08-13" } ], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-06-08T14:05:41.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\nIf a project contains a JS file ending with {{*.bootstrap.js}}, then every Android incremental build performed will duplicate its entry within our {{ti.internal/bootstrap.json}} file. This causes the bootstrap JS file to be executed multiple times on startup.\r\n\r\nThis regression was introduced in Titanium 8.1.0.\r\n\r\n*Note:*\r\nThis only negatively impacts bootstraps that have an {{execute()}} function such as [ti.playservices|https://github.com/appcelerator-modules/ti.playservices/blob/master/android/Resources/ti.playservices/ti.playservices.bootstrap.js], because that function will end up being invoked multiple times.\r\n\r\n*Steps to reproduce:*\r\n# Create a Titanium app project.\r\n# Copy the below {{test.bootstrap.js}} to the {{Resources}} directory.\r\n# Build and run on Android.\r\n# Notice a bootstrap dialog appears once. _(This is good.)_\r\n# Build and run on Android again.\r\n# Notice *two* bootstrap dialogs appear on startup. _(This is bad.)_\r\n# Build and run on Android again.\r\n# Notice *three* bootstrap dialogs appear on startup. _(This is bad.)_\r\n\r\n\\\\\r\n{{./Resources/test.bootstrap.js}}\r\n{code:javascript}\r\nTi.API.info(\"### Bootstrap was required-in.\");\r\n\r\nvar wasExecuted = false;\r\nexports.execute = function(finished) {\r\n\tTi.API.info(\"### Bootstrap execute() method was called.\");\r\n\tvar message = \"This is the bootstrap dialog.\";\r\n\tif (wasExecuted) {\r\n\t\tmessage = \"Uh-oh!!! Bootstrap was wrongly executed again.\";\r\n\t}\r\n\tvar dialog = Ti.UI.createAlertDialog({\r\n\t\tmessage: message,\r\n\t\tbuttonNames: ['OK'],\r\n\t\tcancel: 0,\r\n\t\tpersistent: true,\r\n\t});\r\n\tdialog.addEventListener('click', finished);\r\n\tdialog.addEventListener('cancel', finished);\r\n\tdialog.show();\r\n\twasExecuted = true;\r\n};\r\n{code}\r\n\r\n*Cause:*\r\nThe incremental build changes made in Titanium 8.1.0 by [TIMOB-27043] moved bootstrap script finding code to our core [process-js-task.js|https://github.com/appcelerator/titanium_mobile/blob/master/cli/lib/tasks/process-js-task.js] file. The iOS {{_build.js}} was changed to not fetch bootstrap scripts itself anymore... but the same as not done in Android's {{_build.js}} which is why the entries are being duplicated.\r\n", "attachment": [], "flagged": false, "summary": "Android: Incremental build duplicates \"bootstrap.json\" entries as of 8.1.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, "comment": { "comments": [ { "id": "455540", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/11727", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-05-21T20:51:05.000+0000", "updated": "2020-05-21T20:51:05.000+0000" }, { "id": "455558", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nWaiting for Jenkins build", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-05-26T21:03:43.000+0000", "updated": "2020-05-26T21:03:43.000+0000" }, { "id": "455615", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11745", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-06-02T20:51:22.000+0000", "updated": "2020-06-02T20:51:22.000+0000" }, { "id": "455678", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Verified changes in 9.0.3.v20200608051820 and 9.1.0.v20200604104832.\r\n\r\nClosing ticket.", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2020-06-08T14:05:34.000+0000", "updated": "2020-06-08T14:05:34.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }