{ "id": "171792", "key": "ALOY-1622", "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": "20216", "name": "CLI Release 7.0.5", "archived": false, "released": true }, { "id": "20217", "name": "Alloy 1.13.1", "archived": false, "released": true, "releaseDate": "2018-07-18" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-07-18T21:44:36.000+0000", "created": "2018-06-14T09:06:16.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "alloy", "bug", "migration" ], "versions": [ { "id": "20171", "name": "Alloy 1.13.0", "archived": false, "released": true } ], "issuelinks": [], "assignee": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "updated": "2018-07-18T22:12:51.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "13605", "name": "Models" } ], "description": "I tried to do a migration on a model with sql adapter type, following the example of the guide: https://docs.appcelerator.com/platform/latest/#!/guide/Alloy_Sync_Adapters_and_Migrations-section-src-36739597_AlloySyncAdaptersandMigrations-Example\r\nBut the build fails with the error in the attached image. \r\nThe problem seems to be due to a `db` variable that has not been defined in the `/Alloy/lib/alloy/sync/sql.js` file, exactly it is this: https://github.com/appcelerator/alloy/blob/6c311743af90da438f9c30bfdbe29275247daa51/Alloy/lib/alloy/sync/sql.js#L341\r\n\r\nIf I modify it in `var db = Ti.Database.open(config.adapter.db_name);` everything works properly.", "attachment": [ { "id": "65262", "filename": "sql-error.jpg", "author": { "name": "astrovicapps", "key": "astrovicapps", "displayName": "Vittorio Sorbera", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-06-14T08:48:58.000+0000", "size": 113746, "mimeType": "image/jpeg" } ], "flagged": false, "summary": "Migration on a model with sql adapter type: build error due to an undefined variable", "creator": { "name": "astrovicapps", "key": "astrovicapps", "displayName": "Vittorio Sorbera", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "astrovicapps", "key": "astrovicapps", "displayName": "Vittorio Sorbera", "active": true, "timeZone": "Europe/Berlin" }, "environment": "*Operating System*\r\n Name = Mac OS X\r\n Version = 10.13.4\r\n Architecture = 64bit\r\n CPUs = 4\r\n Memory = 16.0GB\r\n*Node.js*\r\n Node.js Version = 8.9.4\r\n npm Version = 5.6.0\r\n*Appcelerator CLI*\r\n Installer = 4.2.13\r\n Core Package = 7.0.3\r\n*Titanium CLI*\r\n CLI Version = 5.1.0\r\n node-appc Version = 0.2.44\r\n*Titanium SDKs*\r\n 7.1.1.GA\r\n Version = 7.1.1 \r\n Platforms = iphone, android\r\n git Hash = 1708b2d\r\n git Timestamp = 4/19/2018 18:20\r\n node-appc Version = 0.2.45 \r\n*Mac OS X*\r\n Command Line Tools = installed\r\n*Intel® Hardware Accelerated Execution Manager (HAXM)*\r\n Installed = yes\r\n Memory Limit = 2 GB\r\n*Java Development Kit*\r\n Version = 1.8.0_131\r\n*Android Platforms*\r\n 1) android-25\r\n Name = Android 7.1.1\r\n API Level = 25\r\n Revision = 2\r\n Skins = HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800, WVGA854, WXGA720, WXGA800, WXGA800-7in\r\n ABIs = x86 ", "comment": { "comments": [ { "id": "438412", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Which Alloy- and appc-cli version do you use? This looks valid and could be a side-effect of recent strict mode or Babel changes. [~eharris] ?\r\n\r\n", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-06-14T12:15:57.000+0000", "updated": "2018-06-14T12:16:51.000+0000" }, { "id": "438413", "author": { "name": "astrovicapps", "key": "astrovicapps", "displayName": "Vittorio Sorbera", "active": true, "timeZone": "Europe/Berlin" }, "body": "* alloy 1.12.0\r\n* appc-cli 7.0.3\r\n* hyperloop 3.0.5\r\n", "updateAuthor": { "name": "astrovicapps", "key": "astrovicapps", "displayName": "Vittorio Sorbera", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-06-14T13:44:26.000+0000", "updated": "2018-06-14T13:44:26.000+0000" }, { "id": "438533", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "[~hknoechel] You're more than likely correct, it looks to be due to {{db}} being assigned without ever being declared in scope, which with strict mode is an error. It looks to only be a problem on Android.\r\n\r\nPR here https://github.com/appcelerator/alloy/pull/898", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2018-06-19T21:35:59.000+0000", "updated": "2018-06-19T21:35:59.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }