You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/02/07 22:51:00 UTC
[GitHub] connor-odoherty opened a new issue #291: FileWriter fails during
FileRead step for large documents amidst a high volume of previous
downloads on iOS
connor-odoherty opened a new issue #291: FileWriter fails during FileRead step for large documents amidst a high volume of previous downloads on iOS
URL: https://github.com/apache/cordova-plugin-file/issues/291
The problem as the user sees it:
1. User has long list of documents they need to download to iOS device (200+)
2. User starts the download, with each file downloaded in succession.
3. At the end of the download queue, they discover that one of the files fails (and its always one of two specific files that are 25MB+)
4. They retry the job (which only downloads the failed document) and it succeeds
What I'm seeing as a developer:
1. My app pulls down the document as a blob
2. The app calls `this.file.writeFile(directoryPath, fileName, blob, {replace: true})`
3. For the file that fails, I see the error pop out as
```
{"type":"error","bubbles":false,"cancelBubble":false,"cancelable":false,"lengthComputable":false,"loaded":0,"total":0,"target":{"fileName":"","length":0,"localURL":"cdvfile://localhost/persistent/downloaded-assets/9ce34f8a-6201-4023-9f5b-de6133bd5699/{{redacted}}","position":0,"readyState":2,"result":null,"error":{},"onwritestart":null,"onprogress":null,"onwriteend":null,"onabort":null}}
```
Which is not super helpful.
My debugging has led me to observe that the download fails in FileReader.js (which is called as part of the FileWriter step) with the line `return this._realReader.readAsArrayBuffer(file);` https://github.com/apache/cordova-plugin-file/blob/4a92bbbea755aa9e5bf8cfd160fb9da1cd3287cd/www/FileReader.js#L287
This is problematic because _realReader is set as `this._realReader = origFileReader ? new origFileReader() : {};`, and I have no idea how to access that for debugging.
To make matters worse, when I put a debugging statement here: https://github.com/apache/cordova-plugin-file/blob/4a92bbbea755aa9e5bf8cfd160fb9da1cd3287cd/www/FileWriter.js#L125, the error just prints out as an empty hash, telling me nothing.
Do you have any idea what might be going on here? Is it a memory issue on iOS? Does Cordova timeout over multiple repeated requests?
Something to note, the full list download works fine every time on the iOS xCode simulator. This is leading me to believe it might be a memory issue, but I'm not sure.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org