cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblotsky <...@git.apache.org>
Subject [GitHub] cordova-plugin-file-transfer pull request: CB-8641 Some file-trans...
Date Wed, 02 Dec 2015 18:35:40 GMT
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file-transfer/pull/118#discussion_r46454382
  
    --- Diff: src/windows/FileTransferProxy.js ---
    @@ -49,6 +49,17 @@ function nativePathToCordova(path) {
         return String(path).replace(/\\/g, '/');
     }
     
    +function alreadyCancelled(opId, errorCb, filePath, server) {
    +    var op = fileTransferOps[opId];
    +    if (op && op.state === FileTransferOperation.CANCELLED) {
    +        // Here we should call errorCB with ABORT_ERR error
    +        errorCb(new FTErr(FTErr.ABORT_ERR, nativePathToCordova(filePath), server));
    --- End diff --
    
    This side effect should not be part of the function. Please place it outside, into the
calling code. It will be duplicated, but that is still somewhat OK; it's definitely better
than someone calling if `alreadyCancelled()` twice in a row and getting their callback called
twice.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message