{ "id": "138019", "key": "ALOY-1162", "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": "16596", "name": "Alloy 1.6.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-10-24T15:29:37.000+0000", "created": "2014-10-13T22:42:00.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "16596", "name": "Alloy 1.6.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "issuelinks": [], "assignee": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "updated": "2015-03-30T21:06: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": "13605", "name": "Models" } ], "description": "h5. Problem description\r\nUsing Backbone 1.1.2, sample app included in returns unexpected data values when fetching for stored persistent Model data (using properties adapter).\r\n\r\nh5. Steps to reproduce\r\nCurrently working on narrowing down the sample code. However it can be reproduced by getting the alloy sample for model/properties (https://github.com/appcelerator/alloy/tree/master/test/apps/models/properties )\r\n\r\n1. Import the sample code\r\n2. Add backbone support in config.json and in the 'exports.definition = {}' add:\r\n{code}\r\n{\r\n\t\"sourcemap\": false,\r\n\t\"adapters\": [\"properties\"],\r\n\t\"backbone\": \"1.1.2\"\r\n}\r\n{code}\r\n3. Edit models/modelTab.js and add\r\n{code}\r\nextendCollection : function(Collection) {\r\n _.extend(Collection.prototype, {\r\n\r\n\t\t\t// For Backbone v1.1.2, uncomment this to override the fetch method\r\n\t\t\t\r\n\t\t\tfetch: function(options) {\r\n\t\t\t\toptions = options ? _.clone(options) : {};\r\n\t\t\t\toptions.reset = true;\r\n\t\t\t\treturn Backbone.Collection.prototype.fetch.call(this, options);\r\n\t\t\t},\r\n\t\t\t\r\n\r\n comparator: function(singleModel) {\r\n\t\t\t\treturn singleModel.get('done');\r\n\t\t\t}\r\n });\r\n\r\n return Collection;\r\n }\r\n{code}\r\n4. Run\r\n5. Click on Increment a few times. Then close the app.\r\nResult: label is updated accordingly as expected, incrementing the count. Displayed label is something like:\r\n{code}\r\nmodel: {\"id\":\"instance\", \"count\":2}\r\n{code}\r\n6. Reopen the app\r\nDisplayed label is now different than expected, returning a new model with count 0 and the previous created/incremented models. \r\nSee attachment.\r\n\r\n\r\n", "attachment": [ { "id": "51956", "filename": "Screen Shot 2014-10-13 at 3.41.19 PM.png", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-13T22:42:00.000+0000", "size": 28976, "mimeType": "image/png" } ], "flagged": false, "summary": "Backbone 1.1.2 : sample returning unexpected data for model attributes", "creator": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 3.4.1.v20141007094537\r\nAppcelerator Studio 3.4.1.201410071616\r\nCLI 3.5.0-dev\r\nAlloy 1.6.0-dev\r\nBackbone JS 1.1.2", "closedSprints": [ { "id": 234, "state": "closed", "name": "2014 Sprint 21 Alloy", "startDate": "2014-10-13T16:36:31.077Z", "endDate": "2014-10-25T01:36:00.000Z", "completeDate": "2014-10-27T13:28:36.470Z", "originBoardId": 124 } ], "comment": { "comments": [ { "id": "328559", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "PR : https://github.com/appcelerator/alloy/pull/593\r\n\r\nFunction Test:\r\n1. Run the sample app included in on Backbone 1.1.2\r\n2. Follow the steps to reproduce listed above, the content of the label content should be the same before and after reopen.", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2014-10-20T03:46:10.000+0000", "updated": "2014-10-20T03:46:10.000+0000" }, { "id": "328792", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "PR merged", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-10-21T13:59:38.000+0000", "updated": "2014-10-21T13:59:38.000+0000" }, { "id": "329299", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "1_6_X: https://github.com/appcelerator/alloy/pull/600", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2014-10-24T06:17:28.000+0000", "updated": "2014-10-24T06:17:28.000+0000" }, { "id": "329338", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "PR merged", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-10-24T15:28:43.000+0000", "updated": "2014-10-24T15:28:43.000+0000" }, { "id": "347792", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed using:\r\n\r\nTitanium SDK 4.0.0.v20150325201813\r\nStudio 4.0.0.201503271912\r\nAppc NPM: 0.3.37\r\nAppc CLI 0.2.204\r\nAlloy 1.6.0-alpha2\r\n\r\nLabel content and list items are maintained through app closures, as described.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-03-30T21:06:30.000+0000", "updated": "2015-03-30T21:06:30.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }