{ "id": "63941", "key": "TIMOB-3309", "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": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11251", "name": "Sprint 2011-16", "archived": true, "released": true, "releaseDate": "2011-04-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-05-18T09:16:39.000+0000", "created": "2011-04-15T03:41:51.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "defect", "ios", "klist", "release-1.7.0", "reported-1.7.0", "rplist" ], "versions": [], "issuelinks": [], "assignee": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-05-18T09:16:39.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": "{html}

I've noticed several people trying to use certain properties\nthat will crash the app. One such example:

\n

HD Ticket here: http://developer.appcelerator.com/helpdesk/view/76207

\n

Will crash the app:

\n
\n  var data = {\n        link: \"https://developer.mozilla.org/en/JavaScript\",\n        name: \"Best online Javascript reference\",\n        message: \"Use Mozilla's online Javascript reference\",\n        caption: \"MDN Javascript Reference\",\n        picture: \"https://developer.mozilla.org/media/img/mdn-logo.png\",\n        description: \"This section of the site is dedicated to JavaScript-the-language, the parts that are not specific to web pages or other host environments...\",\n        test: [ {foo: 'some test'} ]\n    };\n    Titanium.Facebook.requestWithGraphPath('me/feed', data, 'POST', function(e) {//...});\n
\n

Exception thrown: http://pastie.org/1651703

\n

Will crash the app with no exception:

\n
\n  var data = {\n        link: \"https://developer.mozilla.org/en/JavaScript\",\n        name: \"Best online Javascript reference\",\n        message: \"Use Mozilla's online Javascript reference\",\n        caption: \"MDN Javascript Reference\",\n        picture: \"https://developer.mozilla.org/media/img/mdn-logo.png\",\n        description: \"This section of the site is dedicated to JavaScript-the-language, the parts that are not specific to web pages or other host environments...\",\n        test: ['test']\n    };\n    Titanium.Facebook.requestWithGraphPath('me/feed', data, 'POST', function(e) {//...});\n
\n

Will not crash the app:

\n
\n  var data = {\n        link: \"https://developer.mozilla.org/en/JavaScript\",\n        name: \"Best online Javascript reference\",\n        message: \"Use Mozilla's online Javascript reference\",\n        caption: \"MDN Javascript Reference\",\n        picture: \"https://developer.mozilla.org/media/img/mdn-logo.png\",\n        description: \"This section of the site is dedicated to JavaScript-the-language, the parts that are not specific to web pages or other host environments...\",\n        test: 'test'\n    };\n    Titanium.Facebook.requestWithGraphPath('me/feed', data, 'POST', function(e) {//...});\n
\n

Even though 'test' property is irrelevant to the graph API, this\nshould still not throw an exception from our side of things.\nFacebook does have a few properties that require an object literal\n/ dictionary.

{html}", "attachment": [], "flagged": false, "summary": "iOS: Facebook Graph Method Crashes in some circumstances", "creator": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "subtasks": [], "reporter": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "environment": null, "comment": { "comments": [ { "id": "130506", "author": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "body": "{html}

A more relavent test is the following, since the privacy api's\nexpect this type of object:

\n
\n      var data = {\n            privacy: { value: 'CUSTOM', friends: 'SELF' },\n            name: \"Review this: Best online Javascript reference\",\n            message: \"Use Mozilla's online Javascript reference\"\n        };\n        \n        Ti.Facebook.requestWithGraphPath('me/feed', data, 'POST', function(e) {// ...});\n
\n

Stack trace here: http://pastie.org/1723291

\n

If a property is an object literal / dictionary it will throw\nthe above exception. If it's an array, it will simply crash with no\nexception given.

{html}", "updateAuthor": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "created": "2011-04-15T03:41:52.000+0000", "updated": "2011-04-15T03:41:52.000+0000" }, { "id": "130507", "author": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "body": "{html}

The workaround for the above is as follows:

\n
\n      var data = {\n            privacy: '{ value: \"CUSTOM\", friends: \"SELF\" }',\n            name: \"Review this: Best online Javascript reference\",\n            message: \"Use Mozilla's online Javascript reference\"\n        };\n
\n

This will work fine as long as the object literal is actually a\nstring.

{html}", "updateAuthor": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "created": "2011-04-15T03:41:52.000+0000", "updated": "2011-04-15T03:41:52.000+0000" }, { "id": "130508", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "{html}

klist'd, fixed reported-1.7.0 tag, set milestone to tbs

{html}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-04-15T03:41:52.000+0000", "updated": "2011-04-15T03:41:52.000+0000" }, { "id": "130509", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "{html}

and assigned to Reggie

{html}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-04-15T03:41:52.000+0000", "updated": "2011-04-15T03:41:52.000+0000" }, { "id": "130952", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Fixed by commit fb31bd (https://github.com/appcelerator/titanium_mobile/commit/fb31bde75a145f4905393633e313226ba7729d33)", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-18T13:35:36.000+0000", "updated": "2011-04-18T13:35:36.000+0000" }, { "id": "133875", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Neither of the two provided code samples crash iOS (iPhone 4, 4.3.3) or the simulator with 1.7.0RC1. Associated tests in KS also do not crash. Closing.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-05-18T09:16:39.000+0000", "updated": "2011-05-18T09:16:39.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }