{ "id": "154908", "key": "TIMOB-20397", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "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": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "10000", "description": "", "name": "Done" }, "resolutiondate": "2016-08-04T02:52:07.000+0000", "created": "2016-02-13T13:31:08.000+0000", "epic": { "id": 155643, "key": "TIMOB-20555", "name": "iOS: Move codebase to main-thread", "summary": "iOS: Move codebase to main-thread", "color": { "key": "color_4" }, "done": false }, "priority": { "name": "Critical", "id": "1" }, "labels": [ "ios", "mainthread" ], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2016-08-04T02:52:07.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": "This issue occurs in several cases when we want to use a proxy (like TiBlob and TiUILivePhoto) and running on main-thread. The usual warning is {{\\[WARN\\] Creating \\[object TiBlob\\] in a different context than the calling function.}}. Example:\r\n{code:javascript}\r\nTi.Media.openPhotoGallery({\r\n mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],\r\n success: function(e) {\r\n Ti.API.warn(e.mediaType);\r\n Ti.API.warn(e.media);\r\n }\r\n });\r\n\r\nvar win = Ti.UI.createWindow({backgroundColor: \"#fff\"});\r\nwin.open();\r\n{code}\r\n\r\nIt is caused because we create a blob using {{TiBlob *media = \\[\\[\\[TiBlob alloc\\] initWithImage:resultImage\\]\\];}} instead of using the page context:\r\n{code}\r\nTiBlob *media = [[[TiBlob alloc\\] _initWithPageContext:[self pageContext]] autorelease];\r\n[media setImage:resultImage];\r\n{code}\r\n\r\nThis issue effects TIMOB-19666 and possibly many other proxies that have not been tested, yet. We need to make sure that the proxies are created properly and write unit tests to ensure their integrity.", "attachment": [], "flagged": false, "summary": "iOS: Main-Thread: Proxies become nil if not created with pageContext", "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, "closedSprints": [ { "id": 597, "state": "closed", "name": "2016 Sprint 06 SDK", "startDate": "2016-03-12T01:30:59.982Z", "endDate": "2016-03-26T00:30:00.000Z", "completeDate": "2016-03-28T03:38:09.726Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "379528", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~penrique] ping! As far as I understood, we need to init all proxies with {{initWithPageContext}}, otherwise it's causing the warning {{Creating \\[object \\] in a different context than the calling function}}. So should we search all matching inits and migrate them, or is there a smarter solution that could do that automatically? And why does the warning occur only on the main thread?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-03-11T12:26:23.000+0000", "updated": "2016-03-11T12:26:34.000+0000" }, { "id": "379793", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Related to TIMOB-20396, but we should still replace all {{\\[\\[TiBlob alloc] initWithXXXX]]}} occurrences with a proper page context initialization.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-03-15T22:37:18.000+0000", "updated": "2016-03-15T22:37:33.000+0000" }, { "id": "379845", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/7854", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-03-16T09:26:54.000+0000", "updated": "2016-03-16T09:26:54.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }