{ "id": "175824", "key": "TIMOB-28252", "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": "21052", "description": "", "name": "Release 9.3.0", "archived": false, "released": true, "releaseDate": "2020-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-12-03T01:09:34.000+0000", "created": "2020-11-22T22:00:16.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "build", "module", "regression", "v8" ], "versions": [ { "id": "21052", "description": "", "name": "Release 9.3.0", "archived": false, "released": true, "releaseDate": "2020-12-14" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-12-03T01:09:37.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Noticed during the SDK 9.3.0 migration: If you call a module getter and the value is null, thee app now crashes, because a {{Symbol}} type is returned instead of a bare {{null}} value. This works fine on iOS and used to work fine on Android as well (comparing to 9.2.2.GA).\r\n\r\nIt's easy to replicate:\r\n1. Create a native module and add the following code:\r\n{code:java}\r\n@Kroll.getProperty\r\npublic String fcmToken()\r\n{\r\n\treturn null;\r\n}\r\n{code}\r\n2. Add the module to your tiapp.xml with an 9.3.0 SDK included and call the getter:\r\n{code:js}\r\nconsole.warn(require('ti.test').fcmToken));\r\n{code}\r\n3. Notice the error\r\n4. Change the SDK version back to 9.2.2.GA and run the same app again\r\n5. Notice that it's behaving correctly and returning {{null}}.\r\n\r\nI guess it's a regression from some kind of V8 change (see the full 9.2.2 <-- master diff [here|https://github.com/appcelerator/titanium_mobile/compare/9_2_X...9_3_X]). Also see the ti.test module for quick reproduction attached to this ticket.\r\n\r\n*EDIT*: Found a possible regression candidate [this commit|https://github.com/appcelerator/titanium_mobile/commit/33964f2e8a2d8afa6549e9e99d66612b907b7bff#diff-d5344920be4f1fff291a2472f2046fed4f37659c8de7227cb483aeb4cc167484R220] (as part of TIMOB-27787).", "attachment": [ { "id": "67728", "filename": "ti.java.1.0.0.zip", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-11-24T17:58:02.000+0000", "size": 126360, "mimeType": "application/zip" }, { "id": "67726", "filename": "ti.test-android-1.0.0.zip", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-11-22T21:59:52.000+0000", "size": 115241, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: Modules built before 9.3.0 will return empty string instead of null", "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": 1211, "state": "closed", "name": "2020 Sprint 24", "startDate": "2020-11-23T18:12:00.000Z", "endDate": "2020-12-07T18:12:00.000Z", "completeDate": "2020-12-04T22:07:24.313Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "457695", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm not seeing a crash.\r\nHowever, it is returning an empty string when it should be returning null. That is definitely a regression.\r\n\r\nAnd it's only happening with older modules running on 9.3.0 like you said. It doesn't happen with 9.3.0 built modules.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-11-23T22:05:58.000+0000", "updated": "2020-11-23T22:05:58.000+0000" }, { "id": "457697", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reverting the V8 library below restores the old behavior.\r\nhttps://github.com/appcelerator/titanium_mobile/pull/12186\r\n\r\nIt's happening because the inlined V8 constant values have changed between versions causing V8 to index the wrong type (ie: string instead of void, boolean instead of void, etc.).\r\n\r\nWe'll either revert the V8 library or patch the new V8.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-11-23T23:13:29.000+0000", "updated": "2020-11-24T01:08:11.000+0000" }, { "id": "457699", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "It does not return a string for us but a {{Symbol}} type, causing the crash once we access it, e.g. in a log or comparison.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-11-24T08:12:57.000+0000", "updated": "2020-11-24T08:12:57.000+0000" }, { "id": "457702", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/12293", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-11-24T17:17:55.000+0000", "updated": "2020-11-24T17:17:55.000+0000" }, { "id": "457706", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\n{{null}} is returned as expected.\r\nSDK: 9.3.0.v20201124093449", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-11-24T18:38:02.000+0000", "updated": "2020-11-24T18:38:53.000+0000" }, { "id": "457715", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The following PR adds unit tests for verifying module backward compatibility on Android and iOS.\r\nPR (master): https://github.com/appcelerator/titanium_mobile/pull/12311", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-11-25T02:50:23.000+0000", "updated": "2020-12-03T01:09:28.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }