Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20577] Windows: App crashes when calling fetch() on any collection that has data

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-03-22T13:59:39.000+0000
Affected Version/sRelease 5.2.0
Fix Version/sRelease 5.2.1, Alloy 1.8.1
ComponentsWindows
LabelssupportTeam
ReporterJoe Finnigan
AssigneeGary Mathews
Created2016-03-09T16:54:52.000+0000
Updated2019-05-15T14:09:57.000+0000

Description

Creating a collection, and calling fetch if it is emtpy doesn't crash. Create 1 model and save it, then re-fetch the collection the app crashes in the emulator. This is a pretty serious issue if you can't fetch any data?! Not sure what version this dates back to as we're new to windows dev in Titanium. We're adding windows support to longstanding iOS/Android Ti apps. Index.js:
var library = Alloy.createCollection("userForms");
library.fetch();

var user = Alloy.createModel('userForms', {
	Name: "Hello world"
});
user.save();

library.fetch();

$.index.open();
Model:
config: {
		columns: {
		    "Name": "TEXT"
		},
		adapter: {
			type: "sql",
			collection_name: "userForms"
		}
	}

Comments

  1. Christopher Williams 2016-03-16

    [~joef][~nsalahin] This may be fixed by our fix to TIMOB-20222. Can you try this out on a 5.3.0 build of the SDK? You can get a 5.3.0 build by doing:
       appc ti idk install -b 5_3_X
       
    Then you'll need to update your project's tiapp.xml to use it.
  2. Joe Finnigan 2016-03-16

    I've tried it with Ti SDK: 5.3.0.v20160315093329 And it still crashes, getting an error message now that wasn't previously displayed in the console: {panel:title=ConsoleLog} [ERROR] : The remote procedure call failed. [ERROR] : Error: The remote procedure call failed. at ChildProcess. (C:\ProgramData\Titanium\mobilesdk\win32\5.3.0.v20160315093329\node_modules\windowslib\lib\wptool.js:703:10) at emitTwo (events.js:87:13) at ChildProcess.emit (events.js:172:7) at maybeClose (internal/child_process.js:821:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) {panel}
  3. Gary Mathews 2016-03-22

    PR: https://github.com/appcelerator/alloy/pull/771
  4. Christopher Williams 2016-03-22

    Fix was in Alloy itself, so updating to Alloy 1.8.1 should fix the issue for the user.
  5. Ewan Harris 2016-03-23

    Verified using: Windows 10 Pro Appc NPM: 4.2.4-2 Appc Core: 5.2.1-20 Titanium SDK: 5.2.1.v20160318225121 Alloy: 1.8.1 Using the code provided in the description, the app no longer crashes when calling fetch. Closing ticket

JSON Source