{ "id": "93393", "key": "AC-2979", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2012-06-21T11:13:54.000+0000", "created": "2012-06-18T06:25:22.000+0000", "labels": [], "versions": [], "issuelinks": [ { "id": "17927", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "93557", "key": "TIMOB-9662", "fields": { "summary": "Android: Nested CommonJS Modules Replace Existing CommonJS Modules", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:47:59.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "h2. The problem\r\n\r\nLatest CI builds do not cache CommonJS modules (or at least it seems they don't in some cases). That cause all kind of strange issue (one will be demonstrated in test case).\r\n\r\nThis commit causes this behavior: https://github.com/appcelerator/titanium_mobile/commit/70a9f7984281b8e9ab9c8d73ec3afadc79778b8b\r\n\r\n(before that commit, everything works fine)\r\n\r\n\r\nh2. Test case\r\n\r\n{code}\r\n// app.js\r\nfunction runTest() {\r\n var test1 = require('test/test1');\r\n Ti.API.debug(test1.blabla.test);\r\n}\r\n\r\nrunTest();\r\nrunTest();\r\n\r\n\r\n// test/test1.js\r\nTi.API.info('Test 1 require');\r\n\r\nvar test2 = require('test/test2');\r\n\r\nvar myModule = {\r\n blabla: {\r\n test: test2.test + ' Yes, no?'\r\n }\r\n};\r\n\r\nmodule.exports = myModule;\r\n\r\n\r\n\r\n// test/test2.js\r\nvar test = 'Success!';\r\n\r\nvar objectToExport = {\r\n test: test\r\n};\r\n\r\nmodule.exports = objectToExport;\r\n{code}\r\n\r\n\r\nOutput:\r\n\r\n\r\n06-18 13:21:42.790: I/TiAPI(1925): Test 1 require\r\n06-18 13:21:42.800: D/TiAPI(1925): Success! Yes, no?\r\n06-18 13:21:42.800: I/TiAPI(1925): Test 1 require\r\n06-18 13:21:42.800: D/TiAPI(1925): undefined Yes, no?\r\n\r\n\r\nh2. Expected output\r\n\r\nThere should be only one \"Test 1 require\" console line and forth line should be identical to second one.", "attachment": [], "flagged": false, "summary": "Android: CommonJS modules are not cached in latest CI builds", "creator": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "* Titanium SDK version: 2.1.0 (06/15/12 18:41 07aaa5b)\r\n* v8\r\n* Android 3.1\r\n* Thinkpad Tablet\r\n* OSX Lion", "comment": { "comments": [ { "id": "198885", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Btw, this works fine on iOS.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-06-18T06:35:25.000+0000", "updated": "2012-06-18T06:35:25.000+0000" }, { "id": "199531", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-06-21T01:18:22.000+0000", "updated": "2012-06-21T01:18:22.000+0000" }, { "id": "199601", "author": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This ticket is duplicate of TIMOB-9662.", "updateAuthor": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-21T11:13:54.000+0000", "updated": "2012-06-21T11:13:54.000+0000" }, { "id": "281058", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "DUP issue. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-24T22:30:13.000+0000", "updated": "2013-11-24T22:30:13.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }