{ "id": "169082", "key": "TIMOB-25013", "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": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-11-17T18:22:54.000+0000", "created": "2017-07-24T10:53:34.000+0000", "epic": { "id": 169441, "key": "TIMOB-25087", "name": "Mocha test failures", "summary": "Mocha test: Address unit test failures", "color": { "key": "color_4" }, "done": false }, "priority": { "name": "Medium", "id": "3" }, "labels": [ "failure-reviewed" ], "versions": [ { "id": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" } ], "issuelinks": [], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-06T17:49: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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "h5.Description\r\n\r\nWhen performing a not null assertion on a person value returned from a getPersonByIdentifier call the application will crash, the second assertion where the person does not exist works fine\r\n\r\n\r\nYou can use https://github.com/ewanharris/mocha-test to test this, paste the code below and then click the blue label\r\n\r\n\r\n{code}\r\nvar window = Ti.UI.createWindow();\r\n// create a person\r\nvar lbl = Ti.UI.createLabel({\r\n\tbackgroundColor: 'blue',\r\n\twidth: 400\r\n})\r\nwindow.add(lbl)\r\nlbl.addEventListener('click', function(e){\r\n\tvar person = Ti.Contacts.createPerson({\r\n\t\tfirstName: 'Arthur',\r\n\t\tlastName: 'Evans'\r\n\t});\r\n\tTi.Contacts.save();\r\n\t// Query for person we created\r\n\tvar queriedPerson = Ti.Contacts.getPersonByIdentifier(person.identifier);\r\n\tshould(queriedPerson).not.be.null;\r\n\tshould(queriedPerson.firstName).be.eql(person.firstName);\r\n\tshould(queriedPerson.lastName).be.eql(person.lastName);\r\n\tshould(queriedPerson.identifier).be.eql(person.identifier);\r\n\t// remove the person\r\n\tTi.Contacts.removePerson(queriedPerson);\r\n\tTi.Contacts.save();\r\n\t// Make sure they got removed\r\n\tqueriedPerson = Ti.Contacts.getPersonByIdentifier(person.identifier);\r\n\tshould(queriedPerson).be.null;\r\n})\r\nwindow.open();\r\n{code}\r\n\r\nh5.Steps to reproduce\r\n\r\n# Paste the code above into the mocha-test app\r\n# Run the app to a Windows target\r\n# Tap the blue button\r\n\r\nh5.Actual\r\n\r\nApp crashes\r\n\r\nh5.Expected\r\n\r\nApp should not crash", "attachment": [], "flagged": false, "summary": "Windows: Asserting the value returned from getPersonByIdentifier crashes an application", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": "Ti SDK: 7.0.0.v20170722000101\r\nTest: https://github.com/ewanharris/titanium-mobile-mocha-suite/blob/TIMOB-24816/Resources/ti.contacts.test.js#L171-L195\r\nWindows 10 Pro 10.0.15063\r\nLumia 550 10.0", "closedSprints": [ { "id": 963, "state": "closed", "name": "2017 Sprint 22 SDK", "startDate": "2017-10-22T21:43:59.523Z", "endDate": "2017-11-05T22:43:00.000Z", "completeDate": "2017-11-06T16:33:42.425Z", "originBoardId": 114 }, { "id": 968, "state": "closed", "name": "2017 Sprint 23 SDK", "startDate": "2017-11-05T16:37:25.071Z", "endDate": "2017-11-19T16:37:00.000Z", "completeDate": "2017-11-20T18:57:56.565Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "427473", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/1089", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-09-01T06:34:31.000+0000", "updated": "2017-09-01T06:34:31.000+0000" }, { "id": "430929", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "FR Passed\r\n", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2017-11-17T18:24:03.000+0000", "updated": "2017-11-21T18:15:21.000+0000" }, { "id": "440233", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:49:35.000+0000", "updated": "2018-08-06T17:49:35.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }