{ "id": "173578", "key": "ALOY-1686", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "20807", "name": "CLI Release 7.0.12", "archived": false, "released": true, "releaseDate": "2019-06-27" }, { "id": "20810", "name": "Alloy 1.13.10", "archived": false, "released": true, "releaseDate": "2019-05-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-05-16T13:38:31.000+0000", "created": "2019-05-02T09:27:34.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "20486", "name": "Alloy 1.13.9", "archived": false, "released": true, "releaseDate": "2019-03-14" } ], "issuelinks": [ { "id": "57637", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "155581", "key": "TIMOB-20577", "fields": { "summary": "Windows: App crashes when calling fetch() on any collection that has data", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "57638", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "132791", "key": "ALOY-1081", "fields": { "summary": "Improve query selection speed through sync adapter optimizations", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2019-05-17T14:05:35.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": "13605", "name": "Models" } ], "description": "The current master is broken due to changes in the Obj-C JSCore interface (TIMOB-26038):\r\n{code}\r\n[ERROR] Script Error {\r\n[ERROR] column = 38;\r\n[ERROR] line = 214;\r\n[ERROR] message = \"self type check failed for Objective-C instance method\";\r\n[ERROR] sourceURL = \"file:///Users/hans/Library/Developer/CoreSimulator/Devices/884D0F2B-46F2-41D5-AA78-C26BC42BF348/data/Containers/Bundle/Application/B1994734-79D4-40DD-9003-C940456A903D/Lambus.app/alloy/sync/sql.js\";\r\n[ERROR] stack = \" at [native code]\\n at Sync(/alloy/sync/sql.js:214:38)\\n at sync(/alloy.js:92:22)\\n at fetch(/alloy/backbone.js:344:47)\\n at (/app.js:45:24)\\n at global code(/app.js:225:70)\\n at require@[native code]\\n at (/ti.main.js:8997:10)\\n at doLoad(/ti.main.js:8955:15)\\n at loadBootstrapScripts(/ti.main.js:8967:11)\\n at loadAsync(/ti.main.js:8972:23)\\n at global code(/ti.main.js:8994:10)\";\r\n[ERROR] toJSON = \"\";\r\n[ERROR] }\r\n{code}\r\nSpecifically, changes in {{Ti.Database}} seem to have caused this issues. It was triggered by Alloy models which use Backbone in the background which uses Ti.Database in the background.\r\n\r\nTo reproduce, simply create a new Alloy app and create a model as documented in the docs. For the core-team: This is also reproducible in the app you guys have access to.\r\n\r\n*EDIT*: After investigating this, it seems like [this selector|https://github.com/appcelerator/titanium_mobile/pull/10381/files#diff-d0e600e43c92d0fe06ffee452771f44cR125] is causing the issues as it's referenced in the sql.js to get the field from the result-set at the specified index.", "attachment": [], "flagged": false, "summary": "Alloy: App crashes due to context used when accessing Ti.Database API", "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": 1129, "state": "closed", "name": "2019 Sprint 10", "startDate": "2019-04-28T22:06:00.000Z", "endDate": "2019-05-17T22:06:00.000Z", "completeDate": "2019-05-20T16:48:42.522Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "448146", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "cc [~cwilliams] [~jvennemann]", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-05-02T09:27:53.000+0000", "updated": "2019-05-02T09:27:53.000+0000" }, { "id": "448197", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Any update here? We're trying to stay on latest master to report back all issues, but this one is currently breaking us.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-05-06T19:19:32.000+0000", "updated": "2019-05-06T19:19:32.000+0000" }, { "id": "448332", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Another attempt to ping this…Does this really need to slip into a GA again to get people's attention on this? Every app that uses Ti.Database will be broken and I have no idea how the unit tests could have allowed this to be merged.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-05-13T14:30:26.000+0000", "updated": "2019-05-13T14:30:26.000+0000" }, { "id": "448389", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "So at first glance this looks to me like a latent bug in Alloy that happened not to trigger before (oddly). It plays around with the result set's field method a little:\r\n{code:javascript}\r\nvar getField = OS_ANDROID || OS_WINDOWS ? rs.field.bind(rs) : rs.field;\r\n{code}\r\n\r\nNotice that on Windows or Android it uses bind to explicitly tie {{this}} to the ResultSet instance. On iOS it does not.\r\n\r\nAs a result, {{this}} is implicitly the global object: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Function/bind\r\n\r\nChanging that line to always use bind on all platforms fixes the issue. Or simply calling {{rs.field(i);}} which is much more common usage - I'm not sure why this redirection was used in the first place.\r\n\r\nNote that we ran into this exact same bug before on Windows (using JSCore) in TIMOB-20577.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2019-05-15T14:08:28.000+0000", "updated": "2019-05-15T14:10:29.000+0000" }, { "id": "448390", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "https://github.com/appcelerator/alloy/pull/930", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2019-05-15T14:20:05.000+0000", "updated": "2019-05-15T14:20:05.000+0000" }, { "id": "448397", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~cwilliams] Issue fixed, thank you so much!!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-05-15T17:19:14.000+0000", "updated": "2019-05-15T17:19:14.000+0000" }, { "id": "448434", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "1_13_X backport: https://github.com/appcelerator/alloy/pull/931", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2019-05-16T16:34:40.000+0000", "updated": "2019-05-16T16:34:40.000+0000" }, { "id": "448472", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-05-17T12:35:27.000+0000", "updated": "2019-05-17T12:35:27.000+0000" }, { "id": "448476", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket also verified using CLI {{7.1.0-master.16}} with the above steps. ", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-05-17T14:05:28.000+0000", "updated": "2019-05-17T14:05:28.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }