You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2014/09/02 15:01:21 UTC

[jira] [Commented] (CB-7444) Success callback for XHR to local file that doesn't exist on device never called.

    [ https://issues.apache.org/jira/browse/CB-7444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14118162#comment-14118162 ] 

ASF GitHub Bot commented on CB-7444:
------------------------------------

GitHub user vladimir-kotikov opened a pull request:

    https://github.com/apache/cordova-wp8/pull/53

    CB-7444 Fixes XHR callback failure when requested file doesn't exists

    Fix for https://issues.apache.org/jira/browse/CB-7444

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-wp8 CB-7444

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-wp8/pull/53.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #53
    
----
commit d2aeff23032f5d3705cb262d6d7a3e30e6f2b049
Author: Vladimir Kotikov <v-...@microsoft.com>
Date:   2014-09-02T13:00:13Z

    CB-7444 Fixes XHR callback failure when requested file doesn't exists

----


> Success callback for XHR to local file that doesn't exist on device never called.
> ---------------------------------------------------------------------------------
>
>                 Key: CB-7444
>                 URL: https://issues.apache.org/jira/browse/CB-7444
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: WP8
>    Affects Versions: 3.6.0
>            Reporter: Vladimir Kotikov
>            Assignee: Jesse MacFadyen
>            Priority: Critical
>              Labels: wp8, xhr, xhrhelper
>             Fix For: 3.6.0
>
>
> XHR request for local file that doesn't exist on device causes a runtime exception:
> {noformat}
> An exception of type 'System.OutOfMemoryException' occurred in Microsoft.Phone.Interop.ni.dll but was not handled in user code
> {noformat}
> that catched in the XHRHelper code and {{__onXHRLocalCallback}} for this request is never called.
> *Repro steps:*
> 1. Create blank MDD app, add WP8 platform.
> 2. Try to get an unexistant file, e.g.:
> {noformat}
> var xhr = new XMLHttpRequest();
> xhr.open("GET", "../this.file.is.not.exists", true);
> xhr.onload = xhr.onerror = function() {
>     console.log ('Callback called');
> }
> {noformat}
> *Expected:*
> 'Callback called' is printed to console
> *Actual:*
> No output in console.
> Problem is in arguments array, that passed to {{__onXHRLocalCallback}}. Seems that member of this array can't be null, so replace 
> {noformat} new string[] { "404", null, reqId } {noformat}
> with {noformat} new string [] { "404", string.Empty, reqId }{noformat} solves the problem.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)