Apache Cordova
  1. Apache Cordova
  2. CB-2190

FileTransfer does not request more time than the 5 second limit when placed in background.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.7.0
    • Component/s: iOS
    • Labels:
      None
    • Environment:

      iOS 6.0.1, Cordova 2.2.0.

      Description

      I've been running into an issue using FileTransfer on iOS that cropped up as part of my upgrade to Cordova 2.2. Previously I had been on PhoneGap 1.2 (a long time between upgrades I know). When using the 1.2 version, I could start a filetransfer upload (using sample code from here: http://docs.phonegap.com/en/2.2.0/cordova_media_capture_capture.md.html#Capture) and it would continue to run if I returned to the home screen or if I locked the device. Now it appears that suspending the app will cause a FileTransferError to occur with error code 3 and error message "The request timed out".

      After trading some emails with Shazron, he pointed out that the limit to finish up background tasks is 5 seconds. If the task will take longer, the app has to request more time – and FileTransfer does not do this currently (although the CDVLocalStorage plugin in onResignActive does: https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/CDVLocalStorage.m#L378

      1. CDVFileTransfer.m
        25 kB
        Leif Ullman
      2. CDVFileTransfer.h
        3 kB
        Leif Ullman

        Issue Links

          Activity

          Leif Ullman created issue -
          Leif Ullman made changes -
          Field Original Value New Value
          Summary FileTransfer does not request more time than the 5 second limit FileTransfer does not request more time than the 5 second limit when placed in background.
          Description I've been running into an issue using FileTransfer on iOS that cropped up as part of my upgrade to Cordova 2.2. Previously I had been on PhoneGap 1.2 (a long time between upgrades I know). When using the 1.2 version, I could start a filetransfer upload (using sample code from here: http://docs.phonegap.com/en/2.2.0/cordova_media_capture_capture.md.html#Capture) and it would continue to run if I returned to the home screen or if I locked the device. Now it appears that suspending the app will cause a FileTransferError to occur with error code 3 and error message "The request timed out".

          After trading some emails with Shazron, he pointed out that the limit to finish up tasks is 5 seconds. If the task will take longer, the app has to request more time -- and FileTransfer does not do this currently (although the CDVLocalStorage plugin in onResignActive does: https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/CDVLocalStorage.m#L378

          I've been running into an issue using FileTransfer on iOS that cropped up as part of my upgrade to Cordova 2.2. Previously I had been on PhoneGap 1.2 (a long time between upgrades I know). When using the 1.2 version, I could start a filetransfer upload (using sample code from here: http://docs.phonegap.com/en/2.2.0/cordova_media_capture_capture.md.html#Capture) and it would continue to run if I returned to the home screen or if I locked the device. Now it appears that suspending the app will cause a FileTransferError to occur with error code 3 and error message "The request timed out".

          After trading some emails with Shazron, he pointed out that the limit to finish up background tasks is 5 seconds. If the task will take longer, the app has to request more time -- and FileTransfer does not do this currently (although the CDVLocalStorage plugin in onResignActive does: https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/CDVLocalStorage.m#L378

          Leif Ullman made changes -
          Attachment CDVFileTransfer.h [ 12565646 ]
          Attachment CDVFileTransfer.m [ 12565647 ]
          Andrew Grieve made changes -
          Assignee Shazron Abdullah [ shazron ] Ian Clelland [ iclelland ]
          Ian Clelland made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Andrew Grieve made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Fix Version/s 2.7.0 [ 12323934 ]
          Resolution Fixed [ 1 ]
          Andrew Grieve made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Andrew Grieve made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Andrew Grieve made changes -
          Assignee Ian Clelland [ iclelland ] Andrew Grieve [ agrieve ]
          Ian Clelland made changes -
          Link This issue relates to CB-6408 [ CB-6408 ]

            People

            • Assignee:
              Andrew Grieve
              Reporter:
              Leif Ullman
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development