{ "id": "173231", "key": "AC-6181", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2019-04-23T17:37:51.000+0000", "created": "2019-03-25T16:15:26.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2019-04-23T17:37:52.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14544", "name": "Alloy", "description": "Please enter tickets related to the Alloy here." } ], "description": "I have two instanced Collections in one of my Views with data binding. I have the close of the view hooked up to a cleanup function which calls '$.destroy'. Whenever that destroy function is thrown I get an undefined exception {{Uncaught ReferenceError: __alloyId488 is not defined}}. In the alloy code, I see that id is the callback to my collection, but I'm unsure of what could be happening to it. I'm only doing a reset on the collection once I get data back from a request.\r\n{code:javascript}\r\n var __alloyId487 = Alloy.Collections['$.Experts'] || $.Experts;\r\n\r\nfunction __alloyId488(e) {\r\n if (e && e.fromAdapter) {\r\n return;\r\n }\r\n var opts = __alloyId488.opts || {};\r\n var models = __alloyId487.models;\r\n var len = models.length;\r\n var __alloyId483 = [];\r\n for (var i = 0; i < len; i++) {\r\n var __alloyId484 = models[i];\r\n __alloyId484.__transform = TF.transformExpert(__alloyId484);\r\n var __alloyId486 = {\r\n properties: {\r\n backgroundColor: \"transparent\",\r\n selectedBackgroundColor: Alloy.CFG.design.colors.primary,\r\n itemId: __alloyId484.__transform.expertusername\r\n },\r\n expHeader: {\r\n text: 'Preferred ' + __alloyId484.__transform.field + ' Expert'\r\n },\r\n expImg: {\r\n image: __alloyId484.__transform.prefImage\r\n },\r\n expName: {\r\n text: __alloyId484.__transform.expertname\r\n },\r\n expCompany: {\r\n text: __alloyId484.__transform.company\r\n },\r\n expPhone: {\r\n text: __alloyId484.__transform.expert_ph1\r\n },\r\n expEmail: {\r\n text: __alloyId484.__transform.expert_email\r\n },\r\n expWeb: {\r\n text: __alloyId484.__transform.webAddress\r\n },\r\n template: \"expertCard\"\r\n };\r\n __alloyId483.push(__alloyId486);\r\n }\r\n opts.animation ? $.__views.expSection.setItems(__alloyId483, opts.animation) : $.__views.expSection.setItems(__alloyId483);\r\n};\r\n__alloyId487.on('fetch destroy change add remove reset', __alloyId488);\r\n}\r\n__alloyId482.push($.__views.expSection);\r\n$.__views.propSection = Ti.UI.createListSection({\r\n backgroundColor: \"transparent\",\r\n id: \"propSection\"\r\n});\r\n{code}\r\n\r\nBoth collections are included in the XML as follows\r\n{code:XML}\r\n\r\n \r\n \r\n{code}\r\n\r\nI have tried multiple different 7.X sdk versions, as well as different appc CLI versions to see if it was an error with their specific bundled alloy version, but still received the error. Same even after checking out a previous commit of the project where I know the error didn't exist but just keeps cropping up. \r\n\r\nCompletely reinstalled the cli and all my SDKs, but still getting the error. Hopefully commenting out the destroy and manually calling .off() on both Collections is enough of a workaround for now.\r\n", "attachment": [], "flagged": false, "summary": "$.destroy undefined exception on Collection callback", "creator": { "name": "zlitten", "key": "zlitten", "displayName": "Zachary Litten", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "zlitten", "key": "zlitten", "displayName": "Zachary Litten", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "AppC CLI 7.0.10\r\nTiSDK 7.5.1.GA, Alloy 1.13.9\r\nMacOS 10.14.2", "comment": { "comments": [ { "id": "447139", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello,\r\nThanks for reaching out! Can you test the issue on SDK 8.0.0.GA and share a \r\nsimple test case to demonstrate what you are trying?\r\n", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-03-26T03:32:06.000+0000", "updated": "2019-03-26T03:32:06.000+0000" }, { "id": "447166", "author": { "name": "zlitten", "key": "zlitten", "displayName": "Zachary Litten", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I can confirm that upgrading to TiSDK 8.0.0 alleviates the issue although had to do a few workarounds in order to get to that point in the app as our project is not fully ready for 8.", "updateAuthor": { "name": "zlitten", "key": "zlitten", "displayName": "Zachary Litten", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-03-26T18:02:30.000+0000", "updated": "2019-03-26T18:02:30.000+0000" }, { "id": "447315", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~zlitten],Thanks for your feedback. It would be better if you share the complete logs and a simple test project to reproduce the issue on our end.", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-03-28T05:07:38.000+0000", "updated": "2019-03-28T05:07:38.000+0000" }, { "id": "447563", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~zlitten], can you get back to us with the sample code and trace log? Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2019-04-09T18:33:21.000+0000", "updated": "2019-04-09T18:33:21.000+0000" }, { "id": "447567", "author": { "name": "zlitten", "key": "zlitten", "displayName": "Zachary Litten", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello,\r\nI attempted to decouple my code in that specific controller from the rest of the app to bundle a sample. However, after checking out my previous commit of my project where I was experiencing the issue I was unable to reproduce the same error.\r\nTo meet deadlines I had to triage the issue and move on, but I'm not exactly sure what fixed it.\r\n\r\n", "updateAuthor": { "name": "zlitten", "key": "zlitten", "displayName": "Zachary Litten", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-09T21:10:27.000+0000", "updated": "2019-04-09T21:10:27.000+0000" }, { "id": "447774", "author": { "name": "zlitten", "key": "zlitten", "displayName": "Zachary Litten", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The issue ended up reoccurring, however I _think_ I may have found and fixed the cause due to a different error being encountered.\r\n\r\nOn iOS I was having issues opening the Window with the same ListView mentioned above. For some reason it was crashing when initializing the ListView in the Alloy generated code. I didn't see the same behavior on Android.\r\n\r\nAfter some playing around I attributed the crash to one of my conditional statements in a ListSection similar to this example:\r\n{code:xml}\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n{code}\r\n\r\nBy moving that conditional if statement into the ListItem instead it fixed the iOS crash on open and seems to have also fixed the original crash reported in this ticket.", "updateAuthor": { "name": "zlitten", "key": "zlitten", "displayName": "Zachary Litten", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-19T13:11:50.000+0000", "updated": "2019-04-19T13:14:42.000+0000" }, { "id": "447848", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~zlitten], So, I assume your issue is fixed now? do you need any more help? We will close the ticket if we are done here. Thanks. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2019-04-22T22:44:06.000+0000", "updated": "2019-04-22T22:44:06.000+0000" }, { "id": "447907", "author": { "name": "zlitten", "key": "zlitten", "displayName": "Zachary Litten", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes, I believe the issue is fixed and this ticket can be closed.\r\n\r\nYou have my appreciation for your attention on this matter.", "updateAuthor": { "name": "zlitten", "key": "zlitten", "displayName": "Zachary Litten", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-23T14:14:35.000+0000", "updated": "2019-04-23T14:14:35.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }