{ "id": "171232", "key": "TIMOB-25836", "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": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-05-21T11:58:48.000+0000", "created": "2018-03-02T15:29:49.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "ios" ], "versions": [ { "id": "19957", "description": "", "name": "Release 7.1.0", "archived": false, "released": true, "releaseDate": "2018-03-14" }, { "id": "20060", "description": "", "name": "Release 7.0.2", "archived": false, "released": true, "releaseDate": "2018-02-09" } ], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-06-26T20:55:30.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": "The following:\r\n{code:js}\r\nvar functionA = function(arg) {\r\n\tTi.App.removeEventListener('TestCheckNetwork', functionA);\r\n};\r\n\r\nvar functionB = function(arg) {\r\n\tTi.App.removeEventListener('TestCheckNetwork', functionB);\r\n};\r\n\r\nTi.App.addEventListener('TestCheckNetwork', functionA);\r\nTi.App.addEventListener('TestCheckNetwork', functionB);\r\n\r\nTi.App.fireEvent('TestCheckNetwork');\r\n{code}\r\n\r\nIf main-thread is enabled:\r\n{code:xml}\r\n true\r\n{code}\r\nThere is the following issue:\r\n{code}\r\n[ERROR] : Script Error {\r\n[ERROR] : column = 17;\r\n[ERROR] : line = 511;\r\n[ERROR] : message = \"*** Collection <__NSArrayM: 0x608000049ea0> was mutated while being enumerated.\";\r\n[ERROR] : sourceURL = \"\";\r\n[ERROR] : }\r\n[ERROR] : ErrorController is up. ABORTING open\r\n{code}\r\n", "attachment": [ { "id": "64920", "filename": "app.js", "author": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-03T22:37:23.000+0000", "size": 394, "mimeType": "text/javascript" } ], "flagged": false, "summary": "iOS: Using \"run-on-main-thread\", multiple global event listeners do not work", "creator": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "435152", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Please provide a sample reproducible test project for us to test. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-03-03T21:23:43.000+0000", "updated": "2018-03-03T21:23:43.000+0000" }, { "id": "435156", "author": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "body": " [^app.js] ", "updateAuthor": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-03T22:37:40.000+0000", "updated": "2018-03-03T22:37:40.000+0000" }, { "id": "435166", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Please do not use caps in the ticket title and description. It does not help and rather produces the opposite. We will consider looking into it, although it looks like an app issue with duplicate event listeners", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-04T18:45:42.000+0000", "updated": "2018-03-04T18:45:42.000+0000" }, { "id": "435170", "author": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Sorry about the caps, thank you for your reply!", "updateAuthor": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-04T21:00:37.000+0000", "updated": "2018-03-04T21:00:37.000+0000" }, { "id": "435178", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "After taking a peak on this, I am not feeling confident that this should be fixed, although it might be a breaking change coming from the kroll thread. The reason for the error is that your are removing event listeners concurrently, resulting in a race condition. Using the kroll thread, this was a non-issue, because the kroll-thread would just block the whole app, but using the (more performant) main thread, it does not anymore, resulting in this behavior. We will leave the ticket open for now for further investigations.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-05T06:54:29.000+0000", "updated": "2018-03-05T06:54:29.000+0000" }, { "id": "435233", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "In my view, we should fix this. We have to just hold the array from where we are fetching the listener until we do not process all event firing.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-06T09:00:29.000+0000", "updated": "2018-03-06T09:00:49.000+0000" }, { "id": "435234", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR - https://github.com/appcelerator/titanium_mobile/pull/9908", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-06T09:03:45.000+0000", "updated": "2018-03-06T09:03:45.000+0000" }, { "id": "438737", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket.* Verified fix can be seen in SDK Version: {{7.3.0.v20180625114905}}\r\n\r\n*FR (Passed) Test Steps:*\r\n\r\n# Created an application with the code mentioned in the description \r\n# Ran the program\r\n# Application no longer crashed \r\n# {{TestCheckNetwork}} Was fired and could be seen in the console \r\n\r\n*Test Environment*\r\n{code:java}\r\nAPPC Studio: 5.0.0.201712081732\r\nAPPC CLI: 7.0.4\r\niphone 6 (11.2) Emulator\r\nOperating System Name: Mac OS High Sierra\r\nOperating System Version: 10.13\r\nNode.js Version: 8.9.1\r\nXcode 9.2\r\n{code}\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-26T20:55:20.000+0000", "updated": "2018-06-26T20:55:20.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }