{ "id": "159581", "key": "TIMOB-23215", "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": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2016-04-26T14:53:33.000+0000", "created": "2016-04-14T16:07:46.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "windows" ], "versions": [], "issuelinks": [ { "id": "51497", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "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": "51357", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "159582", "key": "TIMOB-23216", "fields": { "summary": "Windows: Data binding: returning false displays false", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-21T23:14:00.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "I have a ListView with Data Binding set up. I have a transform function attached to the binding of a ListSection. But if my transform function doesn't return data the ListItem expects, it crashes the view/window or throws an error which is unusable (unknown error).\r\n\r\nSo for example\r\n{code}\r\n\r\n{code}\r\nBut transform doesn't give the variable labelText, or (not 100% confirmed yet) it returns null/empty result. In this case it goes wrong.\r\n\r\nHappens with Alloy coupled with 5.2.0 and 5.2.1 and 5.3.0", "attachment": [], "flagged": false, "summary": "Windows: Data binding: Using attribute in ListItem that is not in data crashes view", "creator": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Windows phone", "closedSprints": [ { "id": 624, "state": "closed", "name": "2016 Sprint 09 SDK", "startDate": "2016-04-23T00:39:45.452Z", "endDate": "2016-05-07T00:39:00.000Z", "completeDate": "2016-05-09T03:43:10.279Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "382801", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Maybe related to TIMOB23216 but [~topener] could you give us a sample code so we can reproduce the issue on our side? ", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-15T04:41:20.000+0000", "updated": "2016-04-15T04:41:20.000+0000" }, { "id": "382824", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi, the example in the description is already basically what the problem is.\r\n\r\nData provided in transform but not used in ListItem is fine, but data to-be-used in the ListItem that is not provided from the transform crashes the view", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-15T13:52:30.000+0000", "updated": "2016-04-15T13:52:30.000+0000" }, { "id": "382888", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~topener] Could you confirm what kind of value {{labelText}} variable have? I think you are guessing it was empty or null?", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-17T07:15:53.000+0000", "updated": "2016-04-17T07:15:53.000+0000" }, { "id": "382898", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "The data property was missing. Neither null or empty.\r\n\r\n", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-17T10:32:17.000+0000", "updated": "2016-04-17T10:32:17.000+0000" }, { "id": "382905", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hmm I can not reproduce this. I think you mean {{doTransform}} returns object but it doesn't have required property, is that right? For example let say we have {{doTransform}} like below:\r\n\r\n{code:javascript}\r\nfunction doTransform(model) {\r\n\treturn [];\r\n}\r\n{code}\r\n\r\nand then try to bind the missing property ListItem {{title}}:\r\n\r\n{code:xml}\r\n\r\n \r\n\t\r\n \r\n \r\n \r\n \r\n \r\n\t\r\n\r\n{code}\r\n\r\nIt just shows empty List (as expected) and it does not throw \"unknown exception\".\r\n\r\nDid I miss something in this case?", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-17T13:32:21.000+0000", "updated": "2016-04-17T13:32:51.000+0000" }, { "id": "382906", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "I had troubles with this, but for me it never returned an empty array or object. \r\n \r\nI guess it should return something like this\r\n\r\n{code}\r\nfunction doTransform(model) {\r\n\treturn {\r\n test: \"text\",\r\n showTitle: false\r\n };\r\n}\r\n{code}\r\n\r\nand keep the listview the same", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-17T13:59:36.000+0000", "updated": "2016-04-17T13:59:36.000+0000" }, { "id": "382907", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~topener] Yeah, I tried something like that too but app doesn't crash for me... Now I'm guessing that {{doTransform}} contains wrong property that causes ListView crash. Could you dump the actual value? Or at least can you provide a property names?\r\n\r\n{code}\r\nfunction doTransform(model) {\r\n Ti.API.info(JSON.stringify(model));\r\n return {\r\n test: 'text',\r\n showTitle: false\r\n };\r\n}\r\n{code}", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-17T14:31:41.000+0000", "updated": "2016-04-17T14:31:41.000+0000" }, { "id": "383661", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "Figured it out... turned out to be either `null` or `undefined`. I was trying to `get()` a property on a model that didn't exist. Although getting a non-existing property from a model didn't crash anything, trying to insert it in the view did.\r\n\r\nSo that is the actual bug report", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-22T09:22:12.000+0000", "updated": "2016-04-22T09:23:38.000+0000" }, { "id": "383780", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Glad to hear you figure it out...Could you provide a simple sample code that reproduce the issue [~topener] ?\r\n\r\nFrom what you described, I would imagine like this:\r\n{code}\r\nvar book = Alloy.createModel('book', {title:'Green Eggs and Ham', author:'Dr. Seuss'});\r\nvar unknown_prop = book.get('unknown_prop');\r\nbook.save(); // crash??\r\n{code}\r\n", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-25T09:16:59.000+0000", "updated": "2016-04-25T09:16:59.000+0000" }, { "id": "383783", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi,\r\n\r\nthis has nothing to do with models and saving them. It has to do with DataBinding in a ListView. \r\n\r\n{code}\r\nfunction transform(model){\r\n return {\r\n text: model.get('unknown_prop')\r\n };\r\n}\r\n{code}\r\n\r\nAnd that property is used in the xml\r\n\r\n{code}\r\n\r\n{code}", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-25T10:02:49.000+0000", "updated": "2016-04-25T10:10:13.000+0000" }, { "id": "383884", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I still can't reproduce this but I'm trying in various way. Just in case, which version of alloy are you using? Alloy prior to {{1.8.1}} had a issue around model binding (TIMOB-20577) so make sure you use Alloy {{1.8.1}} or {{1.9.x}}. ({{alloy --version}})\r\n", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-26T07:12:39.000+0000", "updated": "2016-04-26T07:12:39.000+0000" }, { "id": "383892", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "Can confirm, behaves better with 1.8.# and crashes with 1.7.#", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-26T08:24:13.000+0000", "updated": "2016-04-26T08:24:13.000+0000" }, { "id": "383927", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Awesome, so you mean crash is fixed in 1.8.x? \r\n\r\nI think I found a potential workaround for a View crash with alloy on my side...adding {{setTimeout}} on updating model ({{save}}) makes View stable for me. I know this is dirty workaround but just in case, hope this works for you too.\r\n\r\n{code}\r\nfunction updateStatus() {\r\n setTimeout(function () {\r\n var todo = todos.get(id);\r\n todo.set({\r\n done: todo.get(\"done\") ? 0 : 1,\r\n date_completed: moment().unix()\r\n }).save();\r\n }, 500);\r\n}\r\n{code}", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-26T14:20:28.000+0000", "updated": "2016-04-26T14:20:28.000+0000" }, { "id": "383929", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "Yeah correct, apologies for that!", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-26T14:28:11.000+0000", "updated": "2016-04-26T14:28:11.000+0000" }, { "id": "383934", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Awesome! \r\n\r\nResolving this ticket as duplicate of TIMOB-20577.", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-26T14:53:33.000+0000", "updated": "2016-04-26T14:53:33.000+0000" }, { "id": "414667", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate with reference to the above comments and links.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-21T23:14:00.000+0000", "updated": "2017-03-21T23:14:00.000+0000" } ], "maxResults": 16, "total": 16, "startAt": 0 } } }