{ "id": "175013", "key": "TIMOB-27898", "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-08T13:58:47.000+0000", "created": "2020-05-18T09:15:44.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "clearInterval", "ios", "race_condition", "regression", "setinterval" ], "versions": [ { "id": "20972", "description": "", "name": "Release 8.3.1", "archived": false, "released": true, "releaseDate": "2020-01-17" }, { "id": "20950", "name": "Release 9.1.0", "archived": false, "released": true, "releaseDate": "2020-08-25" } ], "issuelinks": [ { "id": "58692", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "175495", "key": "TIMOB-28106", "fields": { "summary": "Ti.UI.Button: Titanium.UI.View Button TIMOB-27898 iOS only", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "10100", "description": "This Issue Type is used to create Zephyr Test within Jira.", "name": "Test", "subtask": false } } } } ], "assignee": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2020-09-01T08:27:25.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": "There seem to be a critical regression regarding intervals in SDK 8 and 9 (so maybe caused between SDK 7 and 8?). See the following vanilla Node.js test case for reference (using a classic throttling mechanism):\r\n{code:js}\r\nlet searchTimeout;\r\n\r\nfunction search(value) {\r\n\tif (searchTimeout) {\r\n\t\tconsole.warn('Abort request');\r\n\t\tclearTimeout(searchTimeout);\r\n\t}\r\n\r\n\tsearchTimeout = setTimeout(() => {\r\n console.warn('Start search: ' + value);\r\n\t}, 500);\r\n}\r\n\r\nfunction sleep(ms) {\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n}\r\n\r\n(async function () {\r\n search('m');\r\n search('me');\r\n search('mep');\r\n}());\r\n{code}\r\nThe expected console output is:\r\n{code}\r\nAbort request\r\nAbort request\r\nStart search: mep\r\n{code}\r\n\r\nBut on iOS, the kroll timer manager has different plans with us:\r\n{code}\r\nAbort request\r\nStart search: m\r\nStart search: mep\r\n{code}\r\n\r\nHere is the app test case (wrapped into a quick i/o UI):\r\n{code:js}\r\nlet searchTimeout;\r\n\r\nfunction search(value) {\r\n\tif (searchTimeout) {\r\n\t\tconsole.warn('Abort request');\r\n\t\tclearTimeout(searchTimeout);\r\n\t}\r\n\r\n\tsearchTimeout = setTimeout(() => {\r\n console.warn('Start search: ' + value);\r\n\t}, 500);\r\n}\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n title: 'Test'\r\n});\r\n\r\nbtn.addEventListener('click', function onClick() {\r\n search('m')\r\n search('me')\r\n search('mep')\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n{code}\r\n\r\nNotably, iOS does something wrong here. And Android works just fine (like Node.js).", "attachment": [], "flagged": false, "summary": "iOS: Race condition in setTimeout/clearTimeout (regression)", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "455493", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Can this please be validated on the team side? It's an absolute blocker as it caused multiple parts of our app to behave randomly incorrectly.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-05-19T06:32:02.000+0000", "updated": "2020-05-19T06:32:02.000+0000" }, { "id": "455495", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "I can reproduce with the following\r\n\r\n{code}\r\nSDK 9.0.1.GA\r\nappc CLI 8.0.0\r\nTi CLI 5.2.2\r\niOS 13.4 Simulator (iPhone 11)\r\nxcode 11.4.1\r\n{code}", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-05-19T08:57:40.000+0000", "updated": "2020-05-19T08:57:40.000+0000" }, { "id": "455557", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/11734\r\nPR (9_0_X): https://github.com/appcelerator/titanium_mobile/pull/11735", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-05-26T18:42:48.000+0000", "updated": "2020-05-26T18:42:48.000+0000" }, { "id": "455644", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master for 9.1.0 target, 9_0_X for 9.0.3 target.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-06-04T17:33:57.000+0000", "updated": "2020-06-04T17:33:57.000+0000" }, { "id": "455677", "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-08T13:58:42.000+0000", "updated": "2020-06-08T13:58:42.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }