Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19347] Windows: Ti.Network.HTTPClient.send fails when arg object has non-string/Blob values

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-08-18T23:09:01.000+0000
Affected Version/sRelease 4.1.0
Fix Version/sRelease 5.0.0
ComponentsWindows
Labelsn/a
ReporterJörgen Buder
AssigneeKota Iguchi
Created2015-08-13T14:51:04.000+0000
Updated2015-08-19T23:29:10.000+0000

Description

Our current code assumes that the JSObject has string property names (which is valid) and either String or Ti.Blob values. It needs to handle other value types and convert them into strings. The following works on iOS/Android, but fails on Windows:
var datas = {
        'authenticatestring': Alloy.Globals.authenticateString,
        'functionName': 'registerNewReceiver',
        'apiVersion' : Alloy.Globals.serverApiVersion,
        'languageId' : Alloy.Globals.serverLanguage,
        'deviceId' : Alloy.Globals.deviceId,
        'purchaseId' : 9846598
    };
    httpClient.send();
This is because our code take the numeric value for 'purchaseId' and since it's not a string assumes it's a Blob and attempts to pull a native Ti.Blob object out of it.

Comments

  1. Kota Iguchi 2015-08-18

    https://github.com/appcelerator/titanium_mobile_windows/pull/407
  2. Lokesh Choudhary 2015-08-19

    Verified the fix. Ti.Network.HTTPClient.send does not fail when arg object has non-string/Blob values. Closing. Environment: Appc Studio: 5.0.0.v20150819140421 Ti SDK: 5.0.0.v20150819140421 Ti CLI: 4.1.4 Alloy: 1.6.2 Windows: 8.1 Enterprise 64-bit APPC NPM: 4.2.0-1 APPC CLI: 5.0.0-3 Node : v0.10.37 Device: Nokia Lumia 928 - Windows Phone 8.1 Windows emulator : 8.1

JSON Source