You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Dewang Shah (JIRA)" <ji...@apache.org> on 2012/06/13 16:53:42 UTC

[jira] [Created] (CB-912) FileTransfer.download does not fire error callback when server is unavailable

Dewang Shah created CB-912:
------------------------------

             Summary: FileTransfer.download does not fire error callback when server is unavailable
                 Key: CB-912
                 URL: https://issues.apache.org/jira/browse/CB-912
             Project: Apache Cordova
          Issue Type: Bug
    Affects Versions: 1.8.0
         Environment: Android/iOS
Others untested
            Reporter: Dewang Shah


The download method on FileTransfer never fires the error callback if there is a network connection but the download URL is not accessible. It simply waits forever and does not return.

Reproduction:
        var fileTransfer = new FileTransfer();
        fileTransfer.download('http://nosuchserver/nosuchfile.png', fullPath, function(entry) {
            console.log("download complete: " + entry.fullPath);
        }, function(error) {
            console.log("download error source " + error.source);
            console.log("download error target " + error.target);
            console.log("download error code" + error.code);
        });


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-912) FileTransfer.download does not fire error callback when server is unavailable

Posted by "Shazron Abdullah (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295360#comment-13295360 ] 

Shazron Abdullah commented on CB-912:
-------------------------------------

I see iOS in the Environment, but nothing in Component field, what components does this affect?
                
> FileTransfer.download does not fire error callback when server is unavailable
> -----------------------------------------------------------------------------
>
>                 Key: CB-912
>                 URL: https://issues.apache.org/jira/browse/CB-912
>             Project: Apache Cordova
>          Issue Type: Bug
>    Affects Versions: 1.8.0
>         Environment: Android/iOS
> Others untested
>            Reporter: Dewang Shah
>         Attachments: cb-915-repro.tar.gz
>
>
> The download method on FileTransfer never fires the error callback if there is a network connection but the download URL is not accessible. It simply waits forever and does not return.
> Reproduction:
>         var fileTransfer = new FileTransfer();
>         fileTransfer.download('http://nosuchserver/nosuchfile.png', fullPath, function(entry) {
>             console.log("download complete: " + entry.fullPath);
>         }, function(error) {
>             console.log("download error source " + error.source);
>             console.log("download error target " + error.target);
>             console.log("download error code" + error.code);
>         });

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CB-912) FileTransfer.download does not fire error callback when server is unavailable

Posted by "Filip Maj (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Filip Maj reassigned CB-912:
----------------------------

    Assignee: Filip Maj
    
> FileTransfer.download does not fire error callback when server is unavailable
> -----------------------------------------------------------------------------
>
>                 Key: CB-912
>                 URL: https://issues.apache.org/jira/browse/CB-912
>             Project: Apache Cordova
>          Issue Type: Bug
>    Affects Versions: 1.8.0
>         Environment: Android/iOS
> Others untested
>            Reporter: Dewang Shah
>            Assignee: Filip Maj
>         Attachments: cb-915-repro.tar.gz
>
>
> The download method on FileTransfer never fires the error callback if there is a network connection but the download URL is not accessible. It simply waits forever and does not return.
> Reproduction:
>         var fileTransfer = new FileTransfer();
>         fileTransfer.download('http://nosuchserver/nosuchfile.png', fullPath, function(entry) {
>             console.log("download complete: " + entry.fullPath);
>         }, function(error) {
>             console.log("download error source " + error.source);
>             console.log("download error target " + error.target);
>             console.log("download error code" + error.code);
>         });

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-912) FileTransfer.download does not fire error callback when server is unavailable

Posted by "Simon MacDonald (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295193#comment-13295193 ] 

Simon MacDonald commented on CB-912:
------------------------------------

Okay, I've taken your sample project and it works fine as long as I provide a value for "fullPath" in the fileTransfer.download() call. If I leave "fullPath" as an undeclared variable then I can reproduce your problem. But there isn't much I can do if the variable is undeclared.
                
> FileTransfer.download does not fire error callback when server is unavailable
> -----------------------------------------------------------------------------
>
>                 Key: CB-912
>                 URL: https://issues.apache.org/jira/browse/CB-912
>             Project: Apache Cordova
>          Issue Type: Bug
>    Affects Versions: 1.8.0
>         Environment: Android/iOS
> Others untested
>            Reporter: Dewang Shah
>         Attachments: cb-915-repro.tar.gz
>
>
> The download method on FileTransfer never fires the error callback if there is a network connection but the download URL is not accessible. It simply waits forever and does not return.
> Reproduction:
>         var fileTransfer = new FileTransfer();
>         fileTransfer.download('http://nosuchserver/nosuchfile.png', fullPath, function(entry) {
>             console.log("download complete: " + entry.fullPath);
>         }, function(error) {
>             console.log("download error source " + error.source);
>             console.log("download error target " + error.target);
>             console.log("download error code" + error.code);
>         });

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (CB-912) FileTransfer.download does not fire error callback when server is unavailable

Posted by "Dewang Shah (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294911#comment-13294911 ] 

Dewang Shah edited comment on CB-912 at 6/14/12 9:00 AM:
---------------------------------------------------------

Project with reproduction scenario.

It is really strange that you are getting the error callback. I've attached a sample project which for me just sits on the download function and never invokes the error callback
                
      was (Author: dewang):
    Project with reproduction scenario
                  
> FileTransfer.download does not fire error callback when server is unavailable
> -----------------------------------------------------------------------------
>
>                 Key: CB-912
>                 URL: https://issues.apache.org/jira/browse/CB-912
>             Project: Apache Cordova
>          Issue Type: Bug
>    Affects Versions: 1.8.0
>         Environment: Android/iOS
> Others untested
>            Reporter: Dewang Shah
>         Attachments: cb-915-repro.tar.gz
>
>
> The download method on FileTransfer never fires the error callback if there is a network connection but the download URL is not accessible. It simply waits forever and does not return.
> Reproduction:
>         var fileTransfer = new FileTransfer();
>         fileTransfer.download('http://nosuchserver/nosuchfile.png', fullPath, function(entry) {
>             console.log("download complete: " + entry.fullPath);
>         }, function(error) {
>             console.log("download error source " + error.source);
>             console.log("download error target " + error.target);
>             console.log("download error code" + error.code);
>         });

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CB-912) FileTransfer.download does not fire error callback when server is unavailable

Posted by "Filip Maj (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Filip Maj resolved CB-912.
--------------------------

       Resolution: Fixed
    Fix Version/s: 1.9.0

This is not so much an issue with the framework as an issue with the way this API is being used.

I have added tests for this case to the cordova-js repo and added sanity parameter checking to the FileTransfer methods. If non-truthy values are passed into the source/target parameters for upload and download, FileTransfer will throw an exception now.

This commit is [8d2562|https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=commit;h=8d25620f18e47deb0da95606848fe46e7743df07].
                
> FileTransfer.download does not fire error callback when server is unavailable
> -----------------------------------------------------------------------------
>
>                 Key: CB-912
>                 URL: https://issues.apache.org/jira/browse/CB-912
>             Project: Apache Cordova
>          Issue Type: Bug
>    Affects Versions: 1.8.0
>         Environment: Android/iOS
> Others untested
>            Reporter: Dewang Shah
>            Assignee: Filip Maj
>             Fix For: 1.9.0
>
>         Attachments: cb-915-repro.tar.gz
>
>
> The download method on FileTransfer never fires the error callback if there is a network connection but the download URL is not accessible. It simply waits forever and does not return.
> Reproduction:
>         var fileTransfer = new FileTransfer();
>         fileTransfer.download('http://nosuchserver/nosuchfile.png', fullPath, function(entry) {
>             console.log("download complete: " + entry.fullPath);
>         }, function(error) {
>             console.log("download error source " + error.source);
>             console.log("download error target " + error.target);
>             console.log("download error code" + error.code);
>         });

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-912) FileTransfer.download does not fire error callback when server is unavailable

Posted by "Simon MacDonald (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294526#comment-13294526 ] 

Simon MacDonald commented on CB-912:
------------------------------------

If I run your code as is I get the error method called with an undefined http_status code in the error object. That makes sense considering the site does not exist. If I switch the url to ask for a file that does not exist on my web server I get the error method called with a status of 404 (file not found). I've tried this on both my device and emulator.
                
> FileTransfer.download does not fire error callback when server is unavailable
> -----------------------------------------------------------------------------
>
>                 Key: CB-912
>                 URL: https://issues.apache.org/jira/browse/CB-912
>             Project: Apache Cordova
>          Issue Type: Bug
>    Affects Versions: 1.8.0
>         Environment: Android/iOS
> Others untested
>            Reporter: Dewang Shah
>
> The download method on FileTransfer never fires the error callback if there is a network connection but the download URL is not accessible. It simply waits forever and does not return.
> Reproduction:
>         var fileTransfer = new FileTransfer();
>         fileTransfer.download('http://nosuchserver/nosuchfile.png', fullPath, function(entry) {
>             console.log("download complete: " + entry.fullPath);
>         }, function(error) {
>             console.log("download error source " + error.source);
>             console.log("download error target " + error.target);
>             console.log("download error code" + error.code);
>         });

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (CB-912) FileTransfer.download does not fire error callback when server is unavailable

Posted by "Dewang Shah (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294911#comment-13294911 ] 

Dewang Shah edited comment on CB-912 at 6/14/12 9:02 AM:
---------------------------------------------------------

Project with reproduction scenario.

It is really strange that you are getting the error callback. I've attached a sample project which for me just sits on the download function and never invokes the error callback.

I've tried this on my device (HTC Sensation running Android 2.3.4) and running on a WiFi connection.
                
      was (Author: dewang):
    Project with reproduction scenario.

It is really strange that you are getting the error callback. I've attached a sample project which for me just sits on the download function and never invokes the error callback
                  
> FileTransfer.download does not fire error callback when server is unavailable
> -----------------------------------------------------------------------------
>
>                 Key: CB-912
>                 URL: https://issues.apache.org/jira/browse/CB-912
>             Project: Apache Cordova
>          Issue Type: Bug
>    Affects Versions: 1.8.0
>         Environment: Android/iOS
> Others untested
>            Reporter: Dewang Shah
>         Attachments: cb-915-repro.tar.gz
>
>
> The download method on FileTransfer never fires the error callback if there is a network connection but the download URL is not accessible. It simply waits forever and does not return.
> Reproduction:
>         var fileTransfer = new FileTransfer();
>         fileTransfer.download('http://nosuchserver/nosuchfile.png', fullPath, function(entry) {
>             console.log("download complete: " + entry.fullPath);
>         }, function(error) {
>             console.log("download error source " + error.source);
>             console.log("download error target " + error.target);
>             console.log("download error code" + error.code);
>         });

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-912) FileTransfer.download does not fire error callback when server is unavailable

Posted by "Dewang Shah (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dewang Shah updated CB-912:
---------------------------

    Attachment: cb-915-repro.tar.gz

Project with reproduction scenario
                
> FileTransfer.download does not fire error callback when server is unavailable
> -----------------------------------------------------------------------------
>
>                 Key: CB-912
>                 URL: https://issues.apache.org/jira/browse/CB-912
>             Project: Apache Cordova
>          Issue Type: Bug
>    Affects Versions: 1.8.0
>         Environment: Android/iOS
> Others untested
>            Reporter: Dewang Shah
>         Attachments: cb-915-repro.tar.gz
>
>
> The download method on FileTransfer never fires the error callback if there is a network connection but the download URL is not accessible. It simply waits forever and does not return.
> Reproduction:
>         var fileTransfer = new FileTransfer();
>         fileTransfer.download('http://nosuchserver/nosuchfile.png', fullPath, function(entry) {
>             console.log("download complete: " + entry.fullPath);
>         }, function(error) {
>             console.log("download error source " + error.source);
>             console.log("download error target " + error.target);
>             console.log("download error code" + error.code);
>         });

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira