[jira] [Commented] (CB-7862) FileReader reads large files in a single chunk causing OOM exceptions

2016-08-11 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-7862:
--

[~tl274n] Yes, please open a new bug, and feel free to submit a PR.

I agree with the fix. Note since the bug is in the JS code I think the issue is 
not iOS-specific.

> FileReader reads large files in a single chunk causing OOM exceptions
> -
>
> Key: CB-7862
> URL: https://issues.apache.org/jira/browse/CB-7862
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.0.0
> Environment: Android
>Reporter: shenzhuxi
>Assignee: Jason Ginchereau
>Priority: Critical
>
> In Android, I tried to copy a 14MB file from html file input with 
> org.apache.cordova.file 1.3.1. The App crashed and a 0 byte file was copied. 
> I use http://ngcordova.com/ and here is my code 
> https://github.com/shenzhuxi/readiator/blob/master/src/js/cordova-index.js. 



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Created] (CB-11117) Preparing platforms should skip copying files which haven't changed

2016-04-19 Thread Jason Ginchereau (JIRA)
Jason Ginchereau created CB-7:
-

 Summary: Preparing platforms should skip copying files which 
haven't changed
 Key: CB-7
 URL: https://issues.apache.org/jira/browse/CB-7
 Project: Apache Cordova
  Issue Type: Improvement
  Components: Android, iOS, Windows
Reporter: Jason Ginchereau
Assignee: Jason Ginchereau


Many cordova CLI commands include a "prepare" operation, including 'cordova 
build', 'cordova run', 'cordova plugin add', and more. Every time each of those 
commands runs, the target platform is "prepared", which involves copying all 
files from the [/www, /platforms//platform_www, 
/merges/] to the platform's target www folder, as well as 
copying a bunch of icons and splash screens to platform-specific locations.

For the very first prepare of a platform, all that file copying is necessary. 
But most of the time after that most of the files being copied have not changed 
and therefore don't really need to be copied again. So the typical developer 
inner loop (edit a few source files, build and run the app, repeat) is a lot 
slower than it could be for a Cordova project, especially one that includes a 
significant number of source files or resources.

Instead, Cordova should be smart enough to skip copying of files that haven't 
changed, based on their last-modified timestamp. (But also there should still 
be a way to force a clean/full/non-incremental build if desired.)



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-11042) Add cordova run option to skip prepare

2016-04-15 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-11042?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-11042.
---
Resolution: Fixed

> Add cordova run option to skip prepare
> --
>
> Key: CB-11042
> URL: https://issues.apache.org/jira/browse/CB-11042
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: CordovaLib
>Reporter: Jason Ginchereau
>Assignee: Jason Ginchereau
>
> The 'cordova run' command currently always does a "prepare" operation for the 
> target platform before launching the app. There is a --nobuild option (to 
> skip building the native project), but there isn't a --noprepare option.
> This option will be helpful to optimize build-and-run scenarios in the Visual 
> Studio tools for Cordova. VS always ensures the project is fully prepared and 
> built before trying to launch. So by the time it calls 'cordova run' there is 
> no need to do the prepare step, and it just causes the developer to wait 
> extra seconds for every iteration of the inner loop.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-11042) Add cordova run option to skip prepare

2016-04-12 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-11042:
---

With a small project, skipping the prepare step makes launching the app in VS 
about 1s faster (7s -> 6s) on an average-spec dev PC. It will save even more 
time with a larger project that has many HTML/JS/resource files that would be 
re-copied during the prepare step.

This is one of a few things we're working on to streamline the dev inner loop 
of Cordova projects in VS. (Most others don't require changes to the Cordova 
runtime.) Saving seconds here and there can really add up.

> Add cordova run option to skip prepare
> --
>
> Key: CB-11042
> URL: https://issues.apache.org/jira/browse/CB-11042
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: CordovaLib
>Reporter: Jason Ginchereau
>Assignee: Jason Ginchereau
>
> The 'cordova run' command currently always does a "prepare" operation for the 
> target platform before launching the app. There is a --nobuild option (to 
> skip building the native project), but there isn't a --noprepare option.
> This option will be helpful to optimize build-and-run scenarios in the Visual 
> Studio tools for Cordova. VS always ensures the project is fully prepared and 
> built before trying to launch. So by the time it calls 'cordova run' there is 
> no need to do the prepare step, and it just causes the developer to wait 
> extra seconds for every iteration of the inner loop.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Created] (CB-11042) Add cordova run option to skip prepare

2016-04-07 Thread Jason Ginchereau (JIRA)
Jason Ginchereau created CB-11042:
-

 Summary: Add cordova run option to skip prepare
 Key: CB-11042
 URL: https://issues.apache.org/jira/browse/CB-11042
 Project: Apache Cordova
  Issue Type: Improvement
  Components: CordovaLib
Reporter: Jason Ginchereau
Assignee: Jason Ginchereau


The 'cordova run' command currently always does a "prepare" operation for the 
target platform before launching the app. There is a --nobuild option (to skip 
building the native project), but there isn't a --noprepare option.

This option will be helpful to optimize build-and-run scenarios in the Visual 
Studio tools for Cordova. VS always ensures the project is fully prepared and 
built before trying to launch. So by the time it calls 'cordova run' there is 
no need to do the prepare step, and it just causes the developer to wait extra 
seconds for every iteration of the inner loop.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Created] (CB-11022) Adding plugins prepares platforms, which is redunant and slow

2016-04-05 Thread Jason Ginchereau (JIRA)
Jason Ginchereau created CB-11022:
-

 Summary: Adding plugins prepares platforms, which is redunant and 
slow
 Key: CB-11022
 URL: https://issues.apache.org/jira/browse/CB-11022
 Project: Apache Cordova
  Issue Type: Bug
  Components: CordovaLib
Reporter: Jason Ginchereau


For CB-9617, a change was made to automatically do a 'cordova prepare' 
operation after adding every plugin. As part of the prepare, all the files from 
the project's www directory are re-copied into the platform_www directory. For 
a large project with lots of source files, images, and other resources, this 
copy operation is potentially time-consuming. And it is redundant and 
unnecessary when adding a plugin, because those files do not need to be changed 
when adding a plugin.

For a large project with many plugins, this slow redundant operation is 
repeated for every plugin, making the first-time build (installing all the 
plugins) take a very long time. As an extreme case, a customer reported their 
large project (35 plugins, ~150 MB in www) takes about 2 hours to build the 
first time. Most of that time is spent repeatedly preparing the platforms after 
adding each plugin. The log line that appears to be slow says it is "Generating 
config.xml from defaults for platform ", but what it is actually 
doing is redundantly copying lots of files from www.

This issue can also be observed at a smaller scale when building the Cordova 
mobilespec project, which contains tests for all the core plugins. 



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-10842) Update MSBuild 15 support

2016-03-19 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-10842.
---
Resolution: Invalid

I investigated this problem further and discovered it is a bug in the setup of 
the VS preview version. The appropriate team will fix that bug. So there's no 
change needed in Cordova.

> Update MSBuild 15 support
> -
>
> Key: CB-10842
> URL: https://issues.apache.org/jira/browse/CB-10842
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Windows
>Reporter: Jason Ginchereau
>Assignee: Jason Ginchereau
>  Labels: mustfix, triaged
>
> If you have both MSBuild 14 and 15 installed (VS 2015 and a preview of the 
> next VS version), and you try use VS 2015 to build a Cordova project that 
> targets Windows/Phone 8.1, it will fail because MSBuild 15 is unable to build 
> those target types.
> Support for MSBuild 15 was added to Cordova a couple months ago, as CB-10292. 
> At the time, MSBuild 15 supported all the same targets as MSBuild 14. But 
> since then it has dropped support for building Windows/Phone 8.1 targets. So 
> instead of picking the latest available MSBuild version, Cordova needs to 
> prefer MSBuild 14 when targeting Windows/Phone 8.1.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Closed] (CB-10842) Update MSBuild 15 support

2016-03-18 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau closed CB-10842.
-

> Update MSBuild 15 support
> -
>
> Key: CB-10842
> URL: https://issues.apache.org/jira/browse/CB-10842
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Windows
>Reporter: Jason Ginchereau
>Assignee: Jason Ginchereau
>  Labels: mustfix, triaged
>
> If you have both MSBuild 14 and 15 installed (VS 2015 and a preview of the 
> next VS version), and you try use VS 2015 to build a Cordova project that 
> targets Windows/Phone 8.1, it will fail because MSBuild 15 is unable to build 
> those target types.
> Support for MSBuild 15 was added to Cordova a couple months ago, as CB-10292. 
> At the time, MSBuild 15 supported all the same targets as MSBuild 14. But 
> since then it has dropped support for building Windows/Phone 8.1 targets. So 
> instead of picking the latest available MSBuild version, Cordova needs to 
> prefer MSBuild 14 when targeting Windows/Phone 8.1.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Created] (CB-10842) Update MSBuild 15 support

2016-03-10 Thread Jason Ginchereau (JIRA)
Jason Ginchereau created CB-10842:
-

 Summary: Update MSBuild 15 support
 Key: CB-10842
 URL: https://issues.apache.org/jira/browse/CB-10842
 Project: Apache Cordova
  Issue Type: Bug
  Components: Windows
Reporter: Jason Ginchereau
Assignee: Jason Ginchereau


If you have both MSBuild 14 and 15 installed (VS 2015 and a preview of the next 
VS version), and you try use VS 2015 to build a Cordova project that targets 
Windows/Phone 8.1, it will fail because MSBuild 15 is unable to build those 
target types.

Support for MSBuild 15 was added to Cordova a couple months ago, as CB-10292. 
At the time, MSBuild 15 supported all the same targets as MSBuild 14. But since 
then it has dropped support for building Windows/Phone 8.1 targets. So instead 
of picking the latest available MSBuild version, Cordova needs to prefer 
MSBuild 14 when targeting Windows/Phone 8.1.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-7862) FileReader reads large files in a single chunk causing OOM exceptions

2016-03-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-7862.
--
Resolution: Fixed

> FileReader reads large files in a single chunk causing OOM exceptions
> -
>
> Key: CB-7862
> URL: https://issues.apache.org/jira/browse/CB-7862
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.0.0
> Environment: Android
>Reporter: shenzhuxi
>Assignee: Jason Ginchereau
>Priority: Critical
>
> In Android, I tried to copy a 14MB file from html file input with 
> org.apache.cordova.file 1.3.1. The App crashed and a 0 byte file was copied. 
> I use http://ngcordova.com/ and here is my code 
> https://github.com/shenzhuxi/readiator/blob/master/src/js/cordova-index.js. 



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-10798) Cannot create folder into cordova.file.externalRootDirectory on Android 6.x Marshmallow

2016-03-09 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-10798:
---

Assigning to [~rakatyal] who is working on other Marshmallow permissions issues 
in the file plugin.

> Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
> Marshmallow
> ---
>
> Key: CB-10798
> URL: https://issues.apache.org/jira/browse/CB-10798
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.1.1
> Environment: Android 6.0.1 (Nexus 9 and other 6.x devices), Cordova 
> cli 6.0.0, Android platform 5.1.0
>Reporter: Vito Macchia
>Assignee: Jason Ginchereau
>  Labels: android, triaged
>
> Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
> Marshmallow. It always returns encording error (12), while on Android 5.x 
> (Lollipop) the same code works fine.
> On Marshmallow devices I can succesfully create folders only into 
> cordova.file.externalDataDirectory.
> No matter the value of preference AndroidPersistentFileLocation or 
> AndroidExtraFilesystems.
> Code (some ES6, sorry)
> This snippet uses WinJS Promises - should work with native promises as well 
> or you can just remove promises and pass succes and fail callbacks. It should 
> create MY_Folder/test (both folders, like mkdirp) in the SD Card (regardless 
> if emulated or not) root directory. It works fine with 5.x devices, but 
> returns always FileError.ENCODING_ERR on Marshmallow. 
> {code:title=createDirectory.js|borderStyle=solid}
> function errorCode(e) {
> var msg = '';
> switch (e.code) {
> case FileError.ABORT_ERR:
> msg = 'ABORT_ERR';
> break;
> case FileError.ENCODING_ERR:
> msg = 'ENCODING_ERR';
> break;
> case FileError.NOT_READABLE_ERR:
> msg = 'NOT_READABLE_ERR';
> break;
> case FileError.PATH_EXISTS_ERR:
> msg = 'PATH_EXISTS_ERR';
> break;
> case FileError.QUOTA_EXCEEDED_ERR:
> msg = 'QUOTA_EXCEEDED_ERR';
> break;
> case FileError.NOT_FOUND_ERR:
> msg = 'NOT_FOUND_ERR';
> break;
> case FileError.SECURITY_ERR:
> msg = 'SECURITY_ERR';
> break;
> case FileError.INVALID_MODIFICATION_ERR:
> msg = 'INVALID_MODIFICATION_ERR';
> break;
> case FileError.INVALID_STATE_ERR:
> msg = 'INVALID_STATE_ERR';
> break;
> default:
> msg = 'Unknown Error';
> break;
> };
> console.log('Error: ' + msg, "CODE", e);
> return msg;
> }
> const STATIC_CONTENT_DIR = 'MY_Folder/test';
> function createDirectory(startDirectory = cordova.file.externalRootDirectory) 
> {
> return new WinJS.Promise(function(success, fail) {
> window.resolveLocalFileSystemURL(startDirectory, function(directory) {
> console.log("FS ROOT", directory);
> function fileGetDir(path, cb) {
> console.log("*** PATH", path);
> var fnGetOrCreateDir = function(p, de) {
> var entry = p.shift();
> console.log("PATH", path);
> if (entry) {
> de.getDirectory(entry, {
> create: true,
> exclusive: false
> }, function(dirEntry) {
> console.log("CR", dirEntry);
> fnGetOrCreateDir(p, dirEntry);
> }, fileFSError);
> } else
> if (cb) cb(de);
> };
> if (path) {
> var arPath = path.split("/");
> fnGetOrCreateDir(arPath, directory.filesystem.root);
> } else {
> if (cb) cb(directory);
> }
> }
> fileGetDir(STATIC_CONTENT_DIR, onSuccess);
> }, fileFSError);
> function fileFSError(e) {
> console.log(e.code);
> try {
> console.log("fileFSError: " + JSON.stringify(e) + 
> errorCode(e));
> fail(e);
> } catch (err) {
> fail(err);
> }
> }
> function onSuccess(dirEntry) {
> console.log(dirEntry.fullPath);
> success(dirEntry.fullPath)
> }
> });
> }
> {code}
> I suspect it has something to do with the way the storage should be handled 
> on Marshmallow, see for instance 
> 

[jira] [Assigned] (CB-10798) Cannot create folder into cordova.file.externalRootDirectory on Android 6.x Marshmallow

2016-03-09 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau reassigned CB-10798:
-

Assignee: Raghav Katyal  (was: Jason Ginchereau)

> Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
> Marshmallow
> ---
>
> Key: CB-10798
> URL: https://issues.apache.org/jira/browse/CB-10798
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.1.1
> Environment: Android 6.0.1 (Nexus 9 and other 6.x devices), Cordova 
> cli 6.0.0, Android platform 5.1.0
>Reporter: Vito Macchia
>Assignee: Raghav Katyal
>  Labels: android, triaged
>
> Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
> Marshmallow. It always returns encording error (12), while on Android 5.x 
> (Lollipop) the same code works fine.
> On Marshmallow devices I can succesfully create folders only into 
> cordova.file.externalDataDirectory.
> No matter the value of preference AndroidPersistentFileLocation or 
> AndroidExtraFilesystems.
> Code (some ES6, sorry)
> This snippet uses WinJS Promises - should work with native promises as well 
> or you can just remove promises and pass succes and fail callbacks. It should 
> create MY_Folder/test (both folders, like mkdirp) in the SD Card (regardless 
> if emulated or not) root directory. It works fine with 5.x devices, but 
> returns always FileError.ENCODING_ERR on Marshmallow. 
> {code:title=createDirectory.js|borderStyle=solid}
> function errorCode(e) {
> var msg = '';
> switch (e.code) {
> case FileError.ABORT_ERR:
> msg = 'ABORT_ERR';
> break;
> case FileError.ENCODING_ERR:
> msg = 'ENCODING_ERR';
> break;
> case FileError.NOT_READABLE_ERR:
> msg = 'NOT_READABLE_ERR';
> break;
> case FileError.PATH_EXISTS_ERR:
> msg = 'PATH_EXISTS_ERR';
> break;
> case FileError.QUOTA_EXCEEDED_ERR:
> msg = 'QUOTA_EXCEEDED_ERR';
> break;
> case FileError.NOT_FOUND_ERR:
> msg = 'NOT_FOUND_ERR';
> break;
> case FileError.SECURITY_ERR:
> msg = 'SECURITY_ERR';
> break;
> case FileError.INVALID_MODIFICATION_ERR:
> msg = 'INVALID_MODIFICATION_ERR';
> break;
> case FileError.INVALID_STATE_ERR:
> msg = 'INVALID_STATE_ERR';
> break;
> default:
> msg = 'Unknown Error';
> break;
> };
> console.log('Error: ' + msg, "CODE", e);
> return msg;
> }
> const STATIC_CONTENT_DIR = 'MY_Folder/test';
> function createDirectory(startDirectory = cordova.file.externalRootDirectory) 
> {
> return new WinJS.Promise(function(success, fail) {
> window.resolveLocalFileSystemURL(startDirectory, function(directory) {
> console.log("FS ROOT", directory);
> function fileGetDir(path, cb) {
> console.log("*** PATH", path);
> var fnGetOrCreateDir = function(p, de) {
> var entry = p.shift();
> console.log("PATH", path);
> if (entry) {
> de.getDirectory(entry, {
> create: true,
> exclusive: false
> }, function(dirEntry) {
> console.log("CR", dirEntry);
> fnGetOrCreateDir(p, dirEntry);
> }, fileFSError);
> } else
> if (cb) cb(de);
> };
> if (path) {
> var arPath = path.split("/");
> fnGetOrCreateDir(arPath, directory.filesystem.root);
> } else {
> if (cb) cb(directory);
> }
> }
> fileGetDir(STATIC_CONTENT_DIR, onSuccess);
> }, fileFSError);
> function fileFSError(e) {
> console.log(e.code);
> try {
> console.log("fileFSError: " + JSON.stringify(e) + 
> errorCode(e));
> fail(e);
> } catch (err) {
> fail(err);
> }
> }
> function onSuccess(dirEntry) {
> console.log(dirEntry.fullPath);
> success(dirEntry.fullPath)
> }
> });
> }
> {code}
> I suspect it has something to do with the way the storage should be handled 
> on Marshmallow, see for instance 
> http://developer.android.com/guide/topics/data/data-storage.html and 
> https://source.android.com/devices/storage/



--
This message 

[jira] [Commented] (CB-10798) Cannot create folder into cordova.file.externalRootDirectory on Android 6.x Marshmallow

2016-03-09 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-10798:
---

@Vito Macchia I think you're right, the problem is actually that the file 
plugin is not requesting Android permissions when it needs to. There was 
already some code added to handle the new permission requirements of Android 
6.x, but this way of creating a directory does not go through a code path that 
requests permissions. I'm still investigating.

> Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
> Marshmallow
> ---
>
> Key: CB-10798
> URL: https://issues.apache.org/jira/browse/CB-10798
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.1.1
> Environment: Android 6.0.1 (Nexus 9 and other 6.x devices), Cordova 
> cli 6.0.0, Android platform 5.1.0
>Reporter: Vito Macchia
>Assignee: Jason Ginchereau
>  Labels: android, triaged
>
> Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
> Marshmallow. It always returns encording error (12), while on Android 5.x 
> (Lollipop) the same code works fine.
> On Marshmallow devices I can succesfully create folders only into 
> cordova.file.externalDataDirectory.
> No matter the value of preference AndroidPersistentFileLocation or 
> AndroidExtraFilesystems.
> Code (some ES6, sorry)
> This snippet uses WinJS Promises - should work with native promises as well 
> or you can just remove promises and pass succes and fail callbacks. It should 
> create MY_Folder/test (both folders, like mkdirp) in the SD Card (regardless 
> if emulated or not) root directory. It works fine with 5.x devices, but 
> returns always FileError.ENCODING_ERR on Marshmallow. 
> {code:title=createDirectory.js|borderStyle=solid}
> function errorCode(e) {
> var msg = '';
> switch (e.code) {
> case FileError.ABORT_ERR:
> msg = 'ABORT_ERR';
> break;
> case FileError.ENCODING_ERR:
> msg = 'ENCODING_ERR';
> break;
> case FileError.NOT_READABLE_ERR:
> msg = 'NOT_READABLE_ERR';
> break;
> case FileError.PATH_EXISTS_ERR:
> msg = 'PATH_EXISTS_ERR';
> break;
> case FileError.QUOTA_EXCEEDED_ERR:
> msg = 'QUOTA_EXCEEDED_ERR';
> break;
> case FileError.NOT_FOUND_ERR:
> msg = 'NOT_FOUND_ERR';
> break;
> case FileError.SECURITY_ERR:
> msg = 'SECURITY_ERR';
> break;
> case FileError.INVALID_MODIFICATION_ERR:
> msg = 'INVALID_MODIFICATION_ERR';
> break;
> case FileError.INVALID_STATE_ERR:
> msg = 'INVALID_STATE_ERR';
> break;
> default:
> msg = 'Unknown Error';
> break;
> };
> console.log('Error: ' + msg, "CODE", e);
> return msg;
> }
> const STATIC_CONTENT_DIR = 'MY_Folder/test';
> function createDirectory(startDirectory = cordova.file.externalRootDirectory) 
> {
> return new WinJS.Promise(function(success, fail) {
> window.resolveLocalFileSystemURL(startDirectory, function(directory) {
> console.log("FS ROOT", directory);
> function fileGetDir(path, cb) {
> console.log("*** PATH", path);
> var fnGetOrCreateDir = function(p, de) {
> var entry = p.shift();
> console.log("PATH", path);
> if (entry) {
> de.getDirectory(entry, {
> create: true,
> exclusive: false
> }, function(dirEntry) {
> console.log("CR", dirEntry);
> fnGetOrCreateDir(p, dirEntry);
> }, fileFSError);
> } else
> if (cb) cb(de);
> };
> if (path) {
> var arPath = path.split("/");
> fnGetOrCreateDir(arPath, directory.filesystem.root);
> } else {
> if (cb) cb(directory);
> }
> }
> fileGetDir(STATIC_CONTENT_DIR, onSuccess);
> }, fileFSError);
> function fileFSError(e) {
> console.log(e.code);
> try {
> console.log("fileFSError: " + JSON.stringify(e) + 
> errorCode(e));
> fail(e);
> } catch (err) {
> fail(err);
> }
> }
> function onSuccess(dirEntry) {
> 

[jira] [Resolved] (CB-10577) Android plugin file: resolveLocalFileSystemURL produce incorrect value

2016-03-08 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-10577.
---
Resolution: Fixed

> Android plugin file: resolveLocalFileSystemURL produce incorrect value
> --
>
> Key: CB-10577
> URL: https://issues.apache.org/jira/browse/CB-10577
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Reporter: vldm
>Priority: Critical
>  Labels: android, triaged
> Attachments: index.js
>
>
> On android resolveLocalFileSystemURL  sets isDirectory and isFile properties 
> based on argument URL having trailing slash, and not on actual object type. 
> See attached test program, which currently outputs the following:
>  cdvfile://localhost/temporary/tst is file
>  cdvfile://localhost/temporary/tst/ is directory
> Correct output shall be:
>  cdvfile://localhost/temporary/tst is directory
>  cdvfile://localhost/temporary/tst/ is directory



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-10798) Cannot create folder into cordova.file.externalRootDirectory on Android 6.x Marshmallow

2016-03-08 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-10798:
---

Or perhaps externalRootDirectory should not be deprecated, but this limitation 
on Android 6+ should just be documented in the plugin quirks. Having the 
externalDataDirectory path available may still be useful to applications which 
do not intend to write directly to that root, but rather may intend to read or 
write files in one of the media-specific subdirectories.

> Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
> Marshmallow
> ---
>
> Key: CB-10798
> URL: https://issues.apache.org/jira/browse/CB-10798
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.1.1
> Environment: Android 6.0.1 (Nexus 9 and other 6.x devices), Cordova 
> cli 6.0.0, Android platform 5.1.0
>Reporter: Vito Macchia
>Assignee: Jason Ginchereau
>  Labels: android, triaged
>
> Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
> Marshmallow. It always returns encording error (12), while on Android 5.x 
> (Lollipop) the same code works fine.
> On Marshmallow devices I can succesfully create folders only into 
> cordova.file.externalDataDirectory.
> No matter the value of preference AndroidPersistentFileLocation or 
> AndroidExtraFilesystems.
> Code (some ES6, sorry)
> This snippet uses WinJS Promises - should work with native promises as well 
> or you can just remove promises and pass succes and fail callbacks. It should 
> create MY_Folder/test (both folders, like mkdirp) in the SD Card (regardless 
> if emulated or not) root directory. It works fine with 5.x devices, but 
> returns always FileError.ENCODING_ERR on Marshmallow. 
> {code:title=createDirectory.js|borderStyle=solid}
> function errorCode(e) {
> var msg = '';
> switch (e.code) {
> case FileError.ABORT_ERR:
> msg = 'ABORT_ERR';
> break;
> case FileError.ENCODING_ERR:
> msg = 'ENCODING_ERR';
> break;
> case FileError.NOT_READABLE_ERR:
> msg = 'NOT_READABLE_ERR';
> break;
> case FileError.PATH_EXISTS_ERR:
> msg = 'PATH_EXISTS_ERR';
> break;
> case FileError.QUOTA_EXCEEDED_ERR:
> msg = 'QUOTA_EXCEEDED_ERR';
> break;
> case FileError.NOT_FOUND_ERR:
> msg = 'NOT_FOUND_ERR';
> break;
> case FileError.SECURITY_ERR:
> msg = 'SECURITY_ERR';
> break;
> case FileError.INVALID_MODIFICATION_ERR:
> msg = 'INVALID_MODIFICATION_ERR';
> break;
> case FileError.INVALID_STATE_ERR:
> msg = 'INVALID_STATE_ERR';
> break;
> default:
> msg = 'Unknown Error';
> break;
> };
> console.log('Error: ' + msg, "CODE", e);
> return msg;
> }
> const STATIC_CONTENT_DIR = 'MY_Folder/test';
> function createDirectory(startDirectory = cordova.file.externalRootDirectory) 
> {
> return new WinJS.Promise(function(success, fail) {
> window.resolveLocalFileSystemURL(startDirectory, function(directory) {
> console.log("FS ROOT", directory);
> function fileGetDir(path, cb) {
> console.log("*** PATH", path);
> var fnGetOrCreateDir = function(p, de) {
> var entry = p.shift();
> console.log("PATH", path);
> if (entry) {
> de.getDirectory(entry, {
> create: true,
> exclusive: false
> }, function(dirEntry) {
> console.log("CR", dirEntry);
> fnGetOrCreateDir(p, dirEntry);
> }, fileFSError);
> } else
> if (cb) cb(de);
> };
> if (path) {
> var arPath = path.split("/");
> fnGetOrCreateDir(arPath, directory.filesystem.root);
> } else {
> if (cb) cb(directory);
> }
> }
> fileGetDir(STATIC_CONTENT_DIR, onSuccess);
> }, fileFSError);
> function fileFSError(e) {
> console.log(e.code);
> try {
> console.log("fileFSError: " + JSON.stringify(e) + 
> errorCode(e));
> fail(e);
> } catch (err) {
> fail(err);
> }
> }
> function onSuccess(dirEntry) {
> 

[jira] [Commented] (CB-10798) Cannot create folder into cordova.file.externalRootDirectory on Android 6.x Marshmallow

2016-03-08 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-10798:
---

I've verified that this repros on Android 6.x, and not on 5.x. It appears 
Android 6.x simply blocks any writes to the external root directory.

[~lamuertepeluda], can you explain why you want to write to this directory? The 
[relevant Android 
documentation|http://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory()]
 says "applications should not directly use this top-level directory". Instead 
you should write to one of the media-specific subdirectories (Music, Pictures, 
etc.) or the application-specific directory 
(cordova.file.externalDataDirectory).

Cordova should probably deprecate the externalRootDirectory property and set it 
to null on Android 6+. (Apps should not be relying on it anyway since it is 
null on iOS and Windows platforms.)

> Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
> Marshmallow
> ---
>
> Key: CB-10798
> URL: https://issues.apache.org/jira/browse/CB-10798
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.1.1
> Environment: Android 6.0.1 (Nexus 9 and other 6.x devices), Cordova 
> cli 6.0.0, Android platform 5.1.0
>Reporter: Vito Macchia
>Assignee: Jason Ginchereau
>  Labels: android, triaged
>
> Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
> Marshmallow. It always returns encording error (12), while on Android 5.x 
> (Lollipop) the same code works fine.
> On Marshmallow devices I can succesfully create folders only into 
> cordova.file.externalDataDirectory.
> No matter the value of preference AndroidPersistentFileLocation or 
> AndroidExtraFilesystems.
> Code (some ES6, sorry)
> This snippet uses WinJS Promises - should work with native promises as well 
> or you can just remove promises and pass succes and fail callbacks. It should 
> create MY_Folder/test (both folders, like mkdirp) in the SD Card (regardless 
> if emulated or not) root directory. It works fine with 5.x devices, but 
> returns always FileError.ENCODING_ERR on Marshmallow. 
> {code:title=createDirectory.js|borderStyle=solid}
> function errorCode(e) {
> var msg = '';
> switch (e.code) {
> case FileError.ABORT_ERR:
> msg = 'ABORT_ERR';
> break;
> case FileError.ENCODING_ERR:
> msg = 'ENCODING_ERR';
> break;
> case FileError.NOT_READABLE_ERR:
> msg = 'NOT_READABLE_ERR';
> break;
> case FileError.PATH_EXISTS_ERR:
> msg = 'PATH_EXISTS_ERR';
> break;
> case FileError.QUOTA_EXCEEDED_ERR:
> msg = 'QUOTA_EXCEEDED_ERR';
> break;
> case FileError.NOT_FOUND_ERR:
> msg = 'NOT_FOUND_ERR';
> break;
> case FileError.SECURITY_ERR:
> msg = 'SECURITY_ERR';
> break;
> case FileError.INVALID_MODIFICATION_ERR:
> msg = 'INVALID_MODIFICATION_ERR';
> break;
> case FileError.INVALID_STATE_ERR:
> msg = 'INVALID_STATE_ERR';
> break;
> default:
> msg = 'Unknown Error';
> break;
> };
> console.log('Error: ' + msg, "CODE", e);
> return msg;
> }
> const STATIC_CONTENT_DIR = 'MY_Folder/test';
> function createDirectory(startDirectory = cordova.file.externalRootDirectory) 
> {
> return new WinJS.Promise(function(success, fail) {
> window.resolveLocalFileSystemURL(startDirectory, function(directory) {
> console.log("FS ROOT", directory);
> function fileGetDir(path, cb) {
> console.log("*** PATH", path);
> var fnGetOrCreateDir = function(p, de) {
> var entry = p.shift();
> console.log("PATH", path);
> if (entry) {
> de.getDirectory(entry, {
> create: true,
> exclusive: false
> }, function(dirEntry) {
> console.log("CR", dirEntry);
> fnGetOrCreateDir(p, dirEntry);
> }, fileFSError);
> } else
> if (cb) cb(de);
> };
> if (path) {
> var arPath = path.split("/");
> fnGetOrCreateDir(arPath, directory.filesystem.root);
> } else {
> if (cb) cb(directory);
> }
> }
> 

[jira] [Assigned] (CB-10798) Cannot create folder into cordova.file.externalRootDirectory on Android 6.x Marshmallow

2016-03-08 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau reassigned CB-10798:
-

Assignee: Jason Ginchereau

> Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
> Marshmallow
> ---
>
> Key: CB-10798
> URL: https://issues.apache.org/jira/browse/CB-10798
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.1.1
> Environment: Android 6.0.1 (Nexus 9 and other 6.x devices), Cordova 
> cli 6.0.0, Android platform 5.1.0
>Reporter: Vito Macchia
>Assignee: Jason Ginchereau
>  Labels: android, triaged
>
> Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
> Marshmallow. It always returns encording error (12), while on Android 5.x 
> (Lollipop) the same code works fine.
> On Marshmallow devices I can succesfully create folders only into 
> cordova.file.externalDataDirectory.
> No matter the value of preference AndroidPersistentFileLocation or 
> AndroidExtraFilesystems.
> Code (some ES6, sorry)
> This snippet uses WinJS Promises - should work with native promises as well 
> or you can just remove promises and pass succes and fail callbacks. It should 
> create MY_Folder/test (both folders, like mkdirp) in the SD Card (regardless 
> if emulated or not) root directory. It works fine with 5.x devices, but 
> returns always FileError.ENCODING_ERR on Marshmallow. 
> {code:title=createDirectory.js|borderStyle=solid}
> function errorCode(e) {
> var msg = '';
> switch (e.code) {
> case FileError.ABORT_ERR:
> msg = 'ABORT_ERR';
> break;
> case FileError.ENCODING_ERR:
> msg = 'ENCODING_ERR';
> break;
> case FileError.NOT_READABLE_ERR:
> msg = 'NOT_READABLE_ERR';
> break;
> case FileError.PATH_EXISTS_ERR:
> msg = 'PATH_EXISTS_ERR';
> break;
> case FileError.QUOTA_EXCEEDED_ERR:
> msg = 'QUOTA_EXCEEDED_ERR';
> break;
> case FileError.NOT_FOUND_ERR:
> msg = 'NOT_FOUND_ERR';
> break;
> case FileError.SECURITY_ERR:
> msg = 'SECURITY_ERR';
> break;
> case FileError.INVALID_MODIFICATION_ERR:
> msg = 'INVALID_MODIFICATION_ERR';
> break;
> case FileError.INVALID_STATE_ERR:
> msg = 'INVALID_STATE_ERR';
> break;
> default:
> msg = 'Unknown Error';
> break;
> };
> console.log('Error: ' + msg, "CODE", e);
> return msg;
> }
> const STATIC_CONTENT_DIR = 'MY_Folder/test';
> function createDirectory(startDirectory = cordova.file.externalRootDirectory) 
> {
> return new WinJS.Promise(function(success, fail) {
> window.resolveLocalFileSystemURL(startDirectory, function(directory) {
> console.log("FS ROOT", directory);
> function fileGetDir(path, cb) {
> console.log("*** PATH", path);
> var fnGetOrCreateDir = function(p, de) {
> var entry = p.shift();
> console.log("PATH", path);
> if (entry) {
> de.getDirectory(entry, {
> create: true,
> exclusive: false
> }, function(dirEntry) {
> console.log("CR", dirEntry);
> fnGetOrCreateDir(p, dirEntry);
> }, fileFSError);
> } else
> if (cb) cb(de);
> };
> if (path) {
> var arPath = path.split("/");
> fnGetOrCreateDir(arPath, directory.filesystem.root);
> } else {
> if (cb) cb(directory);
> }
> }
> fileGetDir(STATIC_CONTENT_DIR, onSuccess);
> }, fileFSError);
> function fileFSError(e) {
> console.log(e.code);
> try {
> console.log("fileFSError: " + JSON.stringify(e) + 
> errorCode(e));
> fail(e);
> } catch (err) {
> fail(err);
> }
> }
> function onSuccess(dirEntry) {
> console.log(dirEntry.fullPath);
> success(dirEntry.fullPath)
> }
> });
> }
> {code}
> I suspect it has something to do with the way the storage should be handled 
> on Marshmallow, see for instance 
> http://developer.android.com/guide/topics/data/data-storage.html and 
> https://source.android.com/devices/storage/



--
This message was sent by Atlassian 

[jira] [Commented] (CB-10798) Cannot create folder into cordova.file.externalRootDirectory on Android 6.x Marshmallow

2016-03-08 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-10798:
---

Note error code 12 is FileError.PATH_EXISTS_ERR (not ENCODING_ERR). So that 
probably indicates that the externalRootDirectory path is incorrect. I'll 
investigate further.

> Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
> Marshmallow
> ---
>
> Key: CB-10798
> URL: https://issues.apache.org/jira/browse/CB-10798
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.1.1
> Environment: Android 6.0.1 (Nexus 9 and other 6.x devices), Cordova 
> cli 6.0.0, Android platform 5.1.0
>Reporter: Vito Macchia
>  Labels: android, triaged
>
> Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
> Marshmallow. It always returns encording error (12), while on Android 5.x 
> (Lollipop) the same code works fine.
> On Marshmallow devices I can succesfully create folders only into 
> cordova.file.externalDataDirectory.
> No matter the value of preference AndroidPersistentFileLocation or 
> AndroidExtraFilesystems.
> Code (some ES6, sorry)
> This snippet uses WinJS Promises - should work with native promises as well 
> or you can just remove promises and pass succes and fail callbacks. It should 
> create MY_Folder/test (both folders, like mkdirp) in the SD Card (regardless 
> if emulated or not) root directory. It works fine with 5.x devices, but 
> returns always FileError.ENCODING_ERR on Marshmallow. 
> {code:title=createDirectory.js|borderStyle=solid}
> function errorCode(e) {
> var msg = '';
> switch (e.code) {
> case FileError.ABORT_ERR:
> msg = 'ABORT_ERR';
> break;
> case FileError.ENCODING_ERR:
> msg = 'ENCODING_ERR';
> break;
> case FileError.NOT_READABLE_ERR:
> msg = 'NOT_READABLE_ERR';
> break;
> case FileError.PATH_EXISTS_ERR:
> msg = 'PATH_EXISTS_ERR';
> break;
> case FileError.QUOTA_EXCEEDED_ERR:
> msg = 'QUOTA_EXCEEDED_ERR';
> break;
> case FileError.NOT_FOUND_ERR:
> msg = 'NOT_FOUND_ERR';
> break;
> case FileError.SECURITY_ERR:
> msg = 'SECURITY_ERR';
> break;
> case FileError.INVALID_MODIFICATION_ERR:
> msg = 'INVALID_MODIFICATION_ERR';
> break;
> case FileError.INVALID_STATE_ERR:
> msg = 'INVALID_STATE_ERR';
> break;
> default:
> msg = 'Unknown Error';
> break;
> };
> console.log('Error: ' + msg, "CODE", e);
> return msg;
> }
> const STATIC_CONTENT_DIR = 'MY_Folder/test';
> function createDirectory(startDirectory = cordova.file.externalRootDirectory) 
> {
> return new WinJS.Promise(function(success, fail) {
> window.resolveLocalFileSystemURL(startDirectory, function(directory) {
> console.log("FS ROOT", directory);
> function fileGetDir(path, cb) {
> console.log("*** PATH", path);
> var fnGetOrCreateDir = function(p, de) {
> var entry = p.shift();
> console.log("PATH", path);
> if (entry) {
> de.getDirectory(entry, {
> create: true,
> exclusive: false
> }, function(dirEntry) {
> console.log("CR", dirEntry);
> fnGetOrCreateDir(p, dirEntry);
> }, fileFSError);
> } else
> if (cb) cb(de);
> };
> if (path) {
> var arPath = path.split("/");
> fnGetOrCreateDir(arPath, directory.filesystem.root);
> } else {
> if (cb) cb(directory);
> }
> }
> fileGetDir(STATIC_CONTENT_DIR, onSuccess);
> }, fileFSError);
> function fileFSError(e) {
> console.log(e.code);
> try {
> console.log("fileFSError: " + JSON.stringify(e) + 
> errorCode(e));
> fail(e);
> } catch (err) {
> fail(err);
> }
> }
> function onSuccess(dirEntry) {
> console.log(dirEntry.fullPath);
> success(dirEntry.fullPath)
> }
> });
> }
> {code}
> I suspect it has something to do with the way the storage should be handled 
> on Marshmallow, see for instance 
> 

[jira] [Assigned] (CB-7862) FileReader reads large files in a single chunk causing OOM exceptions

2016-03-07 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau reassigned CB-7862:


Assignee: Jason Ginchereau

> FileReader reads large files in a single chunk causing OOM exceptions
> -
>
> Key: CB-7862
> URL: https://issues.apache.org/jira/browse/CB-7862
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.0.0
> Environment: Android
>Reporter: shenzhuxi
>Assignee: Jason Ginchereau
>Priority: Critical
>
> In Android, I tried to copy a 14MB file from html file input with 
> org.apache.cordova.file 1.3.1. The App crashed and a 0 byte file was copied. 
> I use http://ngcordova.com/ and here is my code 
> https://github.com/shenzhuxi/readiator/blob/master/src/js/cordova-index.js. 



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-10425) Android External Storage directories not writable even with permissions

2016-03-01 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-10425.
---
Resolution: Not A Bug

> Android External Storage directories not writable even with permissions
> ---
>
> Key: CB-10425
> URL: https://issues.apache.org/jira/browse/CB-10425
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: Phonegap using plugin cordova-plugin-dialogs
>Reporter: Ryan Mark O'Connor
>  Labels: Android, triaged, wfc
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Using latest phonegap and cordova-plugin-dialogs, checked the following line 
> is present in android xml:
> 
> Trying to execute the following code:
> var dstDir = 
> cordova.file.externalApplicationStorageDirectory.replace("file://", "");
> directory.copyTo(root, dstDir, function() { alert('Export successful. 
> Your exported photos can be found in ' + dstDir); }, errorHandler);
> The error handler is called with error code 6: 
> FileError.NO_MODIFICATION_ALLOWED_ERR
> This also occurs if trying to use the external storage root as the 
> destination directory. How can I get it to work? The value of dstDir on a 
> real android tablet is:
> /storage/emulated/0/Android/data/org.winston.photoarchiver/



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-10425) Android External Storage directories not writable even with permissions

2016-03-01 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-10425:
---

Looking at the above code, there appears to be a mistaken assumption that the 
"root" of the persistent storage filesystem is going to be at "/", when 
actually it is something like "/data/data//files/files". So, 
concatenating the externalApplicationStorageDirectory onto that yields a deep 
directory structure that doesn't exist. The NO_MODIFICATION_ALLOWED_ERR code is 
used whenever the target directory can't be created.

To fix this code, don't use the FS root, instead use 
resolveLocalFileSystemURL(cordova.file.externalApplicationStorageDirectory) to 
get the target directory entry.

> Android External Storage directories not writable even with permissions
> ---
>
> Key: CB-10425
> URL: https://issues.apache.org/jira/browse/CB-10425
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: Phonegap using plugin cordova-plugin-dialogs
>Reporter: Ryan Mark O'Connor
>  Labels: Android, triaged, wfc
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Using latest phonegap and cordova-plugin-dialogs, checked the following line 
> is present in android xml:
> 
> Trying to execute the following code:
> var dstDir = 
> cordova.file.externalApplicationStorageDirectory.replace("file://", "");
> directory.copyTo(root, dstDir, function() { alert('Export successful. 
> Your exported photos can be found in ' + dstDir); }, errorHandler);
> The error handler is called with error code 6: 
> FileError.NO_MODIFICATION_ALLOWED_ERR
> This also occurs if trying to use the external storage root as the 
> destination directory. How can I get it to work? The value of dstDir on a 
> real android tablet is:
> /storage/emulated/0/Android/data/org.winston.photoarchiver/



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-8708) copyTo error

2016-03-01 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-8708?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-8708.
--
Resolution: Not A Bug

> copyTo error 
> -
>
> Key: CB-8708
> URL: https://issues.apache.org/jira/browse/CB-8708
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: org.apache.cordova.file 1.3.4-dev "File" iOS
>Reporter: Rafael B
>  Labels: iOS
>
> I found a new error, but now, IOS version.
> {code}
> var app = {}; 
> window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFileSystem, 
> function() { console.log("3 "+JSON.stringify(rs));});
> function gotFileSystem(v) { 
> app.fileSystem = v; 
> var url = cordova.file.applicationDirectory+"www/1.jpg"; 
> window.resolveLocalFileSystemURL(url, function(entry) {
> var fullPath = cordova.file.applicationStorageDirectory;   
> window.resolveLocalFileSystemURL(fullPath, function(entryDirectory) {
> entry.copyTo(entryDirectory, 'newfile.jpg', function(rs) { 
> console.log(JSON.stringify(rs)); //success   
> }, function() { console.log("1 "+JSON.stringify(rs));} ); //error 
> code 12 in next test's.
> }, function() { console.log("2 "+JSON.stringify(rs));} ); 
>   
> }, function() { console.log("3 "+JSON.stringify(rs));} );  
> }
> {code}
> If execute first time, return success, but execute others time, return error 
> (error code 12)



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8708) copyTo error

2016-03-01 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-8708:
--

Error code 12 is PATH_EXISTS_ERR. See 
https://www.npmjs.com/package/cordova-plugin-file#list-of-error-codes-and-meanings

There's no overwrite flag on the copyTo API, so copying over an existing file 
will require deleting the existing file first.

> copyTo error 
> -
>
> Key: CB-8708
> URL: https://issues.apache.org/jira/browse/CB-8708
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: org.apache.cordova.file 1.3.4-dev "File" iOS
>Reporter: Rafael B
>  Labels: iOS
>
> I found a new error, but now, IOS version.
> {code}
> var app = {}; 
> window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFileSystem, 
> function() { console.log("3 "+JSON.stringify(rs));});
> function gotFileSystem(v) { 
> app.fileSystem = v; 
> var url = cordova.file.applicationDirectory+"www/1.jpg"; 
> window.resolveLocalFileSystemURL(url, function(entry) {
> var fullPath = cordova.file.applicationStorageDirectory;   
> window.resolveLocalFileSystemURL(fullPath, function(entryDirectory) {
> entry.copyTo(entryDirectory, 'newfile.jpg', function(rs) { 
> console.log(JSON.stringify(rs)); //success   
> }, function() { console.log("1 "+JSON.stringify(rs));} ); //error 
> code 12 in next test's.
> }, function() { console.log("2 "+JSON.stringify(rs));} ); 
>   
> }, function() { console.log("3 "+JSON.stringify(rs));} );  
> }
> {code}
> If execute first time, return success, but execute others time, return error 
> (error code 12)



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-8442) [iOS] After several (hundreds) file write operations, the plugin stops working and no error is dispatched.

2016-03-01 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-8442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-8442.
--
Resolution: Duplicate

Based on discussion above, and no further reports of this issue, it appears 
this is no longer a problem on iOS platform versions after CB-8002 was fixed.

Feel free to reactivate if you're still experiencing this problem.

> [iOS] After several (hundreds) file write operations, the plugin stops 
> working and no error is dispatched.
> --
>
> Key: CB-8442
> URL: https://issues.apache.org/jira/browse/CB-8442
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.0.0
> Environment: iOS 8.1.x
> iOS PLATFORM VERSION: 3.7.0
> Simulator, iPad Mini Retina, iPhone 4, iPhone 5s
>Reporter: Andrea
>Priority: Critical
>  Labels: iOS, memory-leak
>
> File Plugin [version 1.3.2]
> After several (hundreds) file write operations (with arrayBuffer), the plugin 
> becomes unresponsive and no error is dispatched.
> Given a list of files, it seems it happens always at the same point ( in my 
> case after 484 write operations, or 492, or 469, etc.). I'm quite sure it's 
> not related to the type of file. No errors are returned. The plugin simply 
> stops working. I guess all the plugins become unresponsive.
> With the same number operations, but executed through FileTransfer-> 
> download, there are no problems.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-7862) FileReader reads large files in a single chunk causing OOM exceptions

2016-03-01 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-7862:
-
Labels:   (was: Android)

> FileReader reads large files in a single chunk causing OOM exceptions
> -
>
> Key: CB-7862
> URL: https://issues.apache.org/jira/browse/CB-7862
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.0.0
> Environment: Android
>Reporter: shenzhuxi
>Priority: Critical
>
> In Android, I tried to copy a 14MB file from html file input with 
> org.apache.cordova.file 1.3.1. The App crashed and a 0 byte file was copied. 
> I use http://ngcordova.com/ and here is my code 
> https://github.com/shenzhuxi/readiator/blob/master/src/js/cordova-index.js. 



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-9853) [Plugin File - Android] Can't read file than 20mb and app crashed.

2016-03-01 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9853?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-9853.
--
Resolution: Duplicate

> [Plugin File - Android] Can't read file than 20mb and app crashed.
> --
>
> Key: CB-9853
> URL: https://issues.apache.org/jira/browse/CB-9853
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 3.0.0
> Environment: Android
>Reporter: Nam Pham
>  Labels: Android
>
> I'm using cordova-plugin-file to read my mp3 file with readAsArrayBuffer 
> method.
> It works perfect with file less than 20mb, but the larger it causes the app 
> to crash with this error. (I'm using crosswalk browser)
> E/chromium( 3330): [ERROR:simple_index_file.cc(223)] Failed to write the 
> temporary index file
> E/chromium( 3330): [ERROR:runtime_javascript_dialog_manager.cc(69)] Not 
> implemented reached in virtual void 
> xwalk::RuntimeJavaScriptDialogManager::ResetDialogState(content::WebContents*)
> So I'm confusing that "is the problem come from xwalk or cordova-plugin-file?"
> Please help me because this plugin can only read file smaller than 20mb size.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-7862) FileReader reads large files in a single chunk causing OOM exceptions

2016-03-01 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-7862:
-
Summary: FileReader reads large files in a single chunk causing OOM 
exceptions  (was: crash when copying big file from html file input with )

> FileReader reads large files in a single chunk causing OOM exceptions
> -
>
> Key: CB-7862
> URL: https://issues.apache.org/jira/browse/CB-7862
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.0.0
> Environment: Android
>Reporter: shenzhuxi
>Priority: Critical
>  Labels: Android
>
> In Android, I tried to copy a 14MB file from html file input with 
> org.apache.cordova.file 1.3.1. The App crashed and a 0 byte file was copied. 
> I use http://ngcordova.com/ and here is my code 
> https://github.com/shenzhuxi/readiator/blob/master/src/js/cordova-index.js. 



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-7862) crash when copying big file from html file input with

2016-03-01 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-7862:
--

I reproduced this problem and looked into the cause. The problem is that the 
Cordova file plugin's implementation of FileReader.readAsArrayBuffer() and 
other FileReader.readAs* methods will always try to read the whole file in a 
single chunk. So if the file is large then the app is likely to crash with an 
out-of-memory exception when it fails to allocate many megabytes of contiguous 
memory.

It should be straightforward to fix the FileReader implementation to read large 
files in smaller chunks. The FileReader API is already designed for that 
anyway, with its onprogress callback.

I've raised the priority to Critical because I think it's a pretty important 
thing to fix (and surprising that it has been broken so long).

> crash when copying big file from html file input with 
> --
>
> Key: CB-7862
> URL: https://issues.apache.org/jira/browse/CB-7862
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.0.0
> Environment: Android
>Reporter: shenzhuxi
>Priority: Critical
>  Labels: Android
>
> In Android, I tried to copy a 14MB file from html file input with 
> org.apache.cordova.file 1.3.1. The App crashed and a 0 byte file was copied. 
> I use http://ngcordova.com/ and here is my code 
> https://github.com/shenzhuxi/readiator/blob/master/src/js/cordova-index.js. 



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-7862) crash when copying big file from html file input with

2016-03-01 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-7862:
-
Priority: Critical  (was: Major)

> crash when copying big file from html file input with 
> --
>
> Key: CB-7862
> URL: https://issues.apache.org/jira/browse/CB-7862
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.0.0
> Environment: Android
>Reporter: shenzhuxi
>Priority: Critical
>  Labels: Android
>
> In Android, I tried to copy a 14MB file from html file input with 
> org.apache.cordova.file 1.3.1. The App crashed and a 0 byte file was copied. 
> I use http://ngcordova.com/ and here is my code 
> https://github.com/shenzhuxi/readiator/blob/master/src/js/cordova-index.js. 



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-9753) index out of bounds on requestFileSystem

2016-02-29 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-9753:
-
Priority: Critical  (was: Major)

> index out of bounds on requestFileSystem
> 
>
> Key: CB-9753
> URL: https://issues.apache.org/jira/browse/CB-9753
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: cordova 5.3.3
> cordova ios 3.9.1
> cordova-plugin-file 2.0.0
> iOS
>Reporter: Denis Babineau
>Priority: Critical
>  Labels: Triaged, easyfix, iOS
>
> CDVFile.m's requestFileSystem: incorrectly checks the bounds of an array:
> if (type > self.fileSystems.count) {
> should read:
> if (type >= self.fileSystems.count) {



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-10384) Marshmallow always request permissions when accessing files

2016-02-29 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-10384:
--
Priority: Critical  (was: Major)

> Marshmallow always request permissions when accessing files
> ---
>
> Key: CB-10384
> URL: https://issues.apache.org/jira/browse/CB-10384
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 5.4.1
> Environment: Android 6.0, cordova-cli 5.4.1, cordova-plugin-file 
> 4.1.0, cordova-android 5.0.0
>Reporter: Kirill Anoshin
>Priority: Critical
>  Labels: Android, triaged
>
> Hi guys is there any sense in this code in FileUtils.java:
> {code}
> if(dirname.contains(cordova.getActivity().getPackageName()) ||
> hasReadPermission()) {
> 
> }
> {code}
> dirname is always look like 'cdvfile://localhost...' this is why it never 
> contains package name. So marshmallow will always request permissions to 
> write to the external storage.
> I'm trying to write to the cordova.file.dataDirectory folder.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-10492) File System API missing in web workers

2016-02-29 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-10492.
---
Resolution: Won't Fix

Web workers don't have access to most of the script context. That includes all 
the script objects injected by Cordova plugins.

Unfortunately the design of Cordova is restricted by the limitations of web 
workers. Cordova cannot simply provide plugin APIs to web workers because the 
mechanism that plugins use to communicate with their native-code counterparts 
is also not available in a web worker context. I think a hypothetical 
implementation would require an elaborate mechanism to automatically marshal 
all plugin API calls and results between the web worker and the main UI thread. 
But that's not something Cordova aspires to do as far as I know.

See also some recent discussion of this issue here:
http://stackoverflow.com/questions/28642547/phonegap-and-webworkers

> File System API missing in web workers
> --
>
> Key: CB-10492
> URL: https://issues.apache.org/jira/browse/CB-10492
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: all
>Reporter: Jim Mont
>  Labels: file, filesystem, javascript, triaged, worker
>
> All File system APIs (provided by cordova-plugin-file) appear to be missing 
> in web workers.  Oddly I can make XMLHttpRequests of the filesystem with file 
> urls in workers.
> In the main view running the following suggests there is no access to the 
> filesystem directly:
> {code:javascript}
> var blob = new Blob(["onmessage = function(e) { var res, fn, msg; try{ fn = 
> new Function(e.data); res = fn(); msg = JSON.stringify(res); }catch(err){ msg 
> = JSON.stringify(err); }; postMessage(msg+' <> '+fn); }"]);
> var blobURL = window.URL.createObjectURL(blob);
> var worker = new Worker(blobURL);
> worker.onmessage = function(e) {
>   console.log('worker',e)
> };
> worker.postMessage('return 1+1');
> worker.postMessage('return self.File');
> worker.postMessage('return self.requestFileSystem');
> {code}



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-10577) Android plugin file: resolveLocalFileSystemURL produce incorrect value

2016-02-29 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-10577:
---

Setting priority to Critical as this is something that really should be fixed 
soon.

> Android plugin file: resolveLocalFileSystemURL produce incorrect value
> --
>
> Key: CB-10577
> URL: https://issues.apache.org/jira/browse/CB-10577
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Reporter: vldm
>Priority: Critical
>  Labels: android, triaged
> Attachments: index.js
>
>
> On android resolveLocalFileSystemURL  sets isDirectory and isFile properties 
> based on argument URL having trailing slash, and not on actual object type. 
> See attached test program, which currently outputs the following:
>  cdvfile://localhost/temporary/tst is file
>  cdvfile://localhost/temporary/tst/ is directory
> Correct output shall be:
>  cdvfile://localhost/temporary/tst is directory
>  cdvfile://localhost/temporary/tst/ is directory



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-10577) Android plugin file: resolveLocalFileSystemURL produce incorrect value

2016-02-29 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-10577:
--
Priority: Critical  (was: Major)

> Android plugin file: resolveLocalFileSystemURL produce incorrect value
> --
>
> Key: CB-10577
> URL: https://issues.apache.org/jira/browse/CB-10577
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Reporter: vldm
>Priority: Critical
>  Labels: android, triaged
> Attachments: index.js
>
>
> On android resolveLocalFileSystemURL  sets isDirectory and isFile properties 
> based on argument URL having trailing slash, and not on actual object type. 
> See attached test program, which currently outputs the following:
>  cdvfile://localhost/temporary/tst is file
>  cdvfile://localhost/temporary/tst/ is directory
> Correct output shall be:
>  cdvfile://localhost/temporary/tst is directory
>  cdvfile://localhost/temporary/tst/ is directory



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-10664) Android cordova.file.externalDataDirectory does not write to sdcard

2016-02-26 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-10664.
---
Resolution: Not A Bug

"External" refers to Android application external storage, which is not 
necessarily on an SD card, even on a device that has an SD card installed. It 
depends on how the Android device manufacturer has configured storage on the 
device. Many devices have application "external" storage configured to point to 
the built-in storage. See some discussion of that here: 
http://stackoverflow.com/questions/12087510/check-if-the-sdcard-is-present-boolean-is-always-true

The Cordova file plugin doesn't currently expose the Android SD card storage 
otherwise, but that would be a feature request, not a bug.

> Android cordova.file.externalDataDirectory does not write to sdcard
> ---
>
> Key: CB-10664
> URL: https://issues.apache.org/jira/browse/CB-10664
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: Android (tested on 5.1.x / 6.0.x)
>Reporter: Fabrizio Bottino
>  Labels: android, triaged
>
> Using a device with "large" internal memory you can't write explicitly to 
> sdcard: every write is emulated to internal memory, even using 
> cordova.file.externalDataDirectory.
> Example: I have two identical tablets, one with sdcard and one without.
> When I write to cordova.file.externalDataDirectory they both write to 
> file:///storage/emulated/0/Android/data//files/ when I expect one of 
> them to write to sdcard.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-10292) Windows platform support for next version of VS/MSBuild

2016-01-06 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10292?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-10292.
---
Resolution: Fixed

> Windows platform support for next version of VS/MSBuild
> ---
>
> Key: CB-10292
> URL: https://issues.apache.org/jira/browse/CB-10292
> Project: Apache Cordova
>  Issue Type: Task
>  Components: Windows
>Reporter: Jason Ginchereau
>Assignee: Jason Ginchereau
>
> Minor updates to the Cordova Windows platform build code are required to 
> support version 15.0 of the VS tools. There are no breaking changes compared 
> to 14.0, so most of the existing code will work; we just need to add the new 
> version to the set of known supported versions.
> This change will allow future preview versions of Visual Studio to continue 
> to work well with Cordova projects.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Created] (CB-10292) Windows platform support for next version of VS/MSBuild

2016-01-04 Thread Jason Ginchereau (JIRA)
Jason Ginchereau created CB-10292:
-

 Summary: Windows platform support for next version of VS/MSBuild
 Key: CB-10292
 URL: https://issues.apache.org/jira/browse/CB-10292
 Project: Apache Cordova
  Issue Type: Task
  Components: Windows
Reporter: Jason Ginchereau
Assignee: Jason Ginchereau


Minor updates to the Cordova Windows platform build code are required to 
support version 15.0 of the VS tools. There are no breaking changes compared to 
14.0, so most of the existing code will work; we just need to add the new 
version to the set of known supported versions.

This change will allow future preview versions of Visual Studio to continue to 
work well with Cordova projects.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-10080) Rewrite file-transfer server not to use disk cache

2015-12-16 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-10080:
---

[~daserge] I was referring to the directories used by 
cordova.file.tempDirectory, as documented in the file plugin README. It varies 
by platform, but that temp directory is typically in an application-private 
location, so it cannot be read by other apps. That would be better than 
allowing formidable to use the user %TEMP%, but obviously not as good as just 
avoiding writing to disk.

> Rewrite file-transfer server not to use disk cache
> --
>
> Key: CB-10080
> URL: https://issues.apache.org/jira/browse/CB-10080
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: mobile-spec
>Reporter: Sergey Shakhnazarov
>Assignee: Sergey Shakhnazarov
>
> See the details in https://github.com/apache/cordova-labs/pull/9



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-10080) Rewrite file-transfer server not to use disk cache

2015-12-09 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-10080:
---

Would it be sufficient to configure formidable to use the application private 
temp folder instead of the OS temp folder that it uses by default?

> Rewrite file-transfer server not to use disk cache
> --
>
> Key: CB-10080
> URL: https://issues.apache.org/jira/browse/CB-10080
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: mobile-spec
>Reporter: Sergey Shakhnazarov
>Assignee: Sergey Shakhnazarov
>
> See the details in https://github.com/apache/cordova-labs/pull/9



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-10125) Cordova build android fails when image files are read-only

2015-12-07 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-10125.
---
Resolution: Fixed

> Cordova build android fails when image files are read-only
> --
>
> Key: CB-10125
> URL: https://issues.apache.org/jira/browse/CB-10125
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: CordovaLib
> Environment: Windows
>Reporter: Jason Ginchereau
>Assignee: Jason Ginchereau
>  Labels: Android
>
> 1. Create a new Cordova project.
> 2. Add the project to a source control system (such as TFS) that adds the 
> read-only attribute to the files.
> 3. Build the project for Android.
> 4. Build again.
> RESULT: The second build fails because it can't overwrite an image file under 
> platforms/android, because the file has the read-only attribute copied from 
> the source file during the first build.
> Here's output from a verbose build showing the stack trace:
> {noformat}
> Error: EPERM, operation not permitted 
> 'D:\Projects\Test167867\platforms\android\res\drawable-land-hdpi\screen.png'
> at Error (native)
> at Object.fs.unlinkSync (fs.js:883:18)
> at android_parser.deleteDefaultResource 
> (C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:80:20)
> at android_parser.handleSplashes 
> (C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:112:14)
> at android_parser.update_from_config 
> (C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:213:10)
> at android_parser.update_project 
> (C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:349:14)
> at PlatformApiPoly.prepare 
> (C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\platforms\PlatformApiPoly.js:212:25)
> at 
> C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\prepare.js:100:32
> at _fulfilled 
> (C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
> at self.promiseDispatch.done 
> (C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
> {noformat}
> This seems to only be a problem with image files. While the read-only 
> attribute is also copied on HTML files & scripts, the build is able to copy 
> over them without a problem.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-9133) CDVFILE NOT WORKING???

2015-12-04 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-9133:
-
Component/s: (was: Plugin File)
 Plugin Whitelist

> CDVFILE NOT WORKING???
> --
>
> Key: CB-9133
> URL: https://issues.apache.org/jira/browse/CB-9133
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Whitelist
>Reporter: Michael Romanovsky
>Assignee: Sergey Shakhnazarov
>Priority: Critical
>
> I used the instructions here:
> https://github.com/apache/cordova-plugin-whitelist
> I have this in my config.xml file:
> 
> 
> 
> I have this in my .HTML file:
> 
> I get these errors:
> Refused to load the script 'http://d3aq14vri881or.cloudfront.net/kiip.js' 
> because it violates the following Content Security Policy directive: 
> "script-src 'self' 'unsafe-inline' 'unsafe-eval'".
> Refused to load the script 'cdvfile://localhost/persistent/free.min.js' 
> because it violates the following Content Security Policy directive: 
> "script-src 'self' 'unsafe-inline' 'unsafe-eval'".
> HELP?!



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-9267) WP8: Cross domain file transfers don't inherit cookies from webbrowser

2015-12-04 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-9267:
-
Labels: WP8  (was: )

> WP8: Cross domain file transfers don't inherit cookies from webbrowser
> --
>
> Key: CB-9267
> URL: https://issues.apache.org/jira/browse/CB-9267
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File Transfer
>Reporter: Leroy van Engelen
>  Labels: WP8
>
> On the wp8 platform, cookies are always copied from the webbrowser when 
> performing a request (introduced in 
> https://github.com/apache/cordova-plugin-file-transfer/pull/74 ).
> However, only the cookies for the currently loaded URL are copied. This makes 
> it impossible to pass cross domain cookies.
> We have written a fix based on using a different webrequest constructor: 
> https://github.com/apache/cordova-plugin-file-transfer/pull/90 .



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Created] (CB-10125) Cordova build android fails when image files are read-only

2015-12-02 Thread Jason Ginchereau (JIRA)
Jason Ginchereau created CB-10125:
-

 Summary: Cordova build android fails when image files are read-only
 Key: CB-10125
 URL: https://issues.apache.org/jira/browse/CB-10125
 Project: Apache Cordova
  Issue Type: Bug
  Components: CordovaLib
 Environment: Windows
Reporter: Jason Ginchereau
Assignee: Jason Ginchereau


1. Create a new Cordova project.
2. Add the project to a source control system (such as TFS) that adds the 
read-only attribute to the files.
3. Build the project for Android.
4. Build again.

RESULT: The second build fails because it can't overwrite an image file under 
platforms/android, because the file has the read-only attribute copied from the 
source file during the first build.

Here's output from a verbose build showing the stack trace:
{noformat}
Error: EPERM, operation not permitted 
'D:\Projects\Test167867\platforms\android\res\drawable-land-hdpi\screen.png'
at Error (native)
at Object.fs.unlinkSync (fs.js:883:18)
at android_parser.deleteDefaultResource 
(C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:80:20)
at android_parser.handleSplashes 
(C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:112:14)
at android_parser.update_from_config 
(C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:213:10)
at android_parser.update_project 
(C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:349:14)
at PlatformApiPoly.prepare 
(C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\platforms\PlatformApiPoly.js:212:25)
at 
C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\prepare.js:100:32
at _fulfilled 
(C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
at self.promiseDispatch.done 
(C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
{noformat}

This seems to only be a problem with image files. While the read-only attribute 
is also copied on HTML files & scripts, the build is able to copy over them 
without a problem.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-8497) FileEntry.remove() and FileEntry.file() fail if the file has '#' in its name

2015-11-17 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-8497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-8497.
--
Resolution: Fixed

> FileEntry.remove() and FileEntry.file() fail if the file has '#' in its name
> 
>
> Key: CB-8497
> URL: https://issues.apache.org/jira/browse/CB-8497
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: iOS 8.1.3 and Android 5.0
>Reporter: Dani Palou
>Assignee: Jason Ginchereau
>  Labels: Triaged
>
> If I try to delete a file that has the character '#' in its name, the 
> 'remove' function always fails, returning FileError.NOT_FOUND_ERR. If the 
> file doesn't have the '#' character, the code works fine. This error is 
> happening both in Android 5 and iOS 8.1.3.
> The same happens for the 'file' function.
> This is one of the FileEntries that I'm testing with:
> {quote}
> fullPath: "/tmp/test#.txt",
> isDirectory: false,
> isFIle: true,
> name: "test#.txt",
> nativeURL: "file:///storage/emulated/0/tmp/test%23.txt"
> {quote}
> I obtained this FileEntry using a DirectoryReader to read the contents of the 
> parent folder.
> I'm testing with PhoneGap CLI 4.2.0, FilePlugin 1.3.3, PhoneGap Android 3.6.4 
> and PhoneGap iOS 3.7.0.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-9999) Cordova file plugin: error: package org.apache.cordova.file does not exist

2015-11-16 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-:
-
Labels: Android  (was: )

> Cordova file plugin: error: package org.apache.cordova.file does not exist
> --
>
> Key: CB-
> URL: https://issues.apache.org/jira/browse/CB-
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Plugin File Transfer
> Environment: MacOS
>Reporter: romeo mihalcea
>  Labels: Android
>
> After installing the `cordova-plugin-file` and trying to run the project I 
> get this error in the console:
> {code:borderStyle=solid}
> .../local/cordova-build/platforms/android/src/org/apache/cordova/filetransfer/FileTransfer.java:59:
>  error: package org.apache.cordova.file does not exist
> import org.apache.cordova.file.FileUtils;
>   ^
> .../local/cordova-build/platforms/android/src/org/apache/cordova/filetransfer/FileTransfer.java:934:
>  error: cannot find symbol
> FileUtils filePlugin = (FileUtils) 
> pm.getPlugin("File");
> ^
>   symbol: class FileUtils
> .../local/cordova-build/platforms/android/src/org/apache/cordova/filetransfer/FileTransfer.java:934:
>  error: cannot find symbol
> FileUtils filePlugin = (FileUtils) 
> pm.getPlugin("File");
> ^
>   symbol: class FileUtils
> Note: Some input files use or override a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
> 3 errors
> :compileDebugJava FAILED
> FAILURE: Build failed with an exception.
> * What went wrong:
> Execution failed for task ':compileDebugJava'.
> > Compilation failed; see the compiler error output for details.
> {code}



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-9991) resolveLocalFileSystemURL returns extra leading slash in nativeURL for some paths

2015-11-16 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-9991:
-
Component/s: (was: iOS)

> resolveLocalFileSystemURL returns extra leading slash in nativeURL for some 
> paths
> -
>
> Key: CB-9991
> URL: https://issues.apache.org/jira/browse/CB-9991
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: cordova 5.3.3
> cordova ios 3.9.1
> cordova-plugin-file 2.0.0
> iOS
>Reporter: Denis Babineau
>  Labels: ios
>
> The following:
> window.resolveLocalFileSystemURL(cordova.file.applicationDirectory, 
> function(e) { console.log("OK:", e); }, function(e) { console.log("ERR:", e); 
> });
> returns an object with nativeURL that looks like this (notice the 4 slashes 
> past the protocol, should be 3 slashes):
> "file:var/mobile/Containers/Bundle/Application/EC6F4A71-B8A8-4156-A43B-C7CB4F39FA19/Test.app/"
> I narrowed it down to CDVLocalFilesystem.m's filesystemPathForFullPath 
> implementation not handling extra leading slashes properly when fsRoot == '/':
> - (NSString *)filesystemPathForFullPath:(NSString *)fullPath
> {
> NSString *path = nil;
> NSString *strippedFullPath = [self stripQueryParametersFromPath:fullPath];
> path = [NSString stringWithFormat:@"%@%@", self.fsRoot, strippedFullPath];
> if ([path length] > 1 && [path hasSuffix:@"/"]) {
>   path = [path substringToIndex:([path length]-1)];
> }
> return path;
> }



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-9991) resolveLocalFileSystemURL returns extra leading slash in nativeURL for some paths

2015-11-16 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-9991:
-
Labels: Triaged easyfix iOS  (was: ios)

> resolveLocalFileSystemURL returns extra leading slash in nativeURL for some 
> paths
> -
>
> Key: CB-9991
> URL: https://issues.apache.org/jira/browse/CB-9991
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: cordova 5.3.3
> cordova ios 3.9.1
> cordova-plugin-file 2.0.0
> iOS
>Reporter: Denis Babineau
>  Labels: Triaged, easyfix, iOS
>
> The following:
> window.resolveLocalFileSystemURL(cordova.file.applicationDirectory, 
> function(e) { console.log("OK:", e); }, function(e) { console.log("ERR:", e); 
> });
> returns an object with nativeURL that looks like this (notice the 4 slashes 
> past the protocol, should be 3 slashes):
> "file:var/mobile/Containers/Bundle/Application/EC6F4A71-B8A8-4156-A43B-C7CB4F39FA19/Test.app/"
> I narrowed it down to CDVLocalFilesystem.m's filesystemPathForFullPath 
> implementation not handling extra leading slashes properly when fsRoot == '/':
> - (NSString *)filesystemPathForFullPath:(NSString *)fullPath
> {
> NSString *path = nil;
> NSString *strippedFullPath = [self stripQueryParametersFromPath:fullPath];
> path = [NSString stringWithFormat:@"%@%@", self.fsRoot, strippedFullPath];
> if ([path length] > 1 && [path hasSuffix:@"/"]) {
>   path = [path substringToIndex:([path length]-1)];
> }
> return path;
> }



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-9982) assets-library:// urls will not work in WKWebView engine

2015-11-16 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9982?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-9982:
-
Labels: iOS  (was: )

> assets-library:// urls will  not work in WKWebView engine
> -
>
> Key: CB-9982
> URL: https://issues.apache.org/jira/browse/CB-9982
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Camera, Plugin File, Plugin WKWebViewEngine
>Reporter: Shazron Abdullah
>  Labels: iOS
>
> This was handled in NSURLProtocol, which cannot intercept WKWebView 
> connections.
> This affects native URIs returned by the Camera and File plugins.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-9999) Cordova file plugin: error: package org.apache.cordova.file does not exist

2015-11-16 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-.
--
Resolution: Cannot Reproduce

I cannot reproduce this issue. I used the following commands on OS X, and the 
app built and ran without problems.

{code}
cordova create TestCB
cd TestCB
cordova platform add Android
cordova plugin add cordova-plugin-file-transfer
cordova run android
{code}

Note when adding the file-transfer plugin, the file plugin it depends on should 
be also added automatically. Based on the error messages it looks like somehow 
you have gotten into a state where you have the file-transfer plugin without 
the file plugin. If you explicitly add the file plugin does that solve the 
problem?

If this is still blocking you, please reactivate this issue and provide more 
details such as the version of Cordova you're using and what plugins and 
platforms you have added to the project.

> Cordova file plugin: error: package org.apache.cordova.file does not exist
> --
>
> Key: CB-
> URL: https://issues.apache.org/jira/browse/CB-
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Plugin File Transfer
> Environment: MacOS
>Reporter: romeo mihalcea
>  Labels: Android
>
> After installing the `cordova-plugin-file` and trying to run the project I 
> get this error in the console:
> {code:borderStyle=solid}
> .../local/cordova-build/platforms/android/src/org/apache/cordova/filetransfer/FileTransfer.java:59:
>  error: package org.apache.cordova.file does not exist
> import org.apache.cordova.file.FileUtils;
>   ^
> .../local/cordova-build/platforms/android/src/org/apache/cordova/filetransfer/FileTransfer.java:934:
>  error: cannot find symbol
> FileUtils filePlugin = (FileUtils) 
> pm.getPlugin("File");
> ^
>   symbol: class FileUtils
> .../local/cordova-build/platforms/android/src/org/apache/cordova/filetransfer/FileTransfer.java:934:
>  error: cannot find symbol
> FileUtils filePlugin = (FileUtils) 
> pm.getPlugin("File");
> ^
>   symbol: class FileUtils
> Note: Some input files use or override a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
> 3 errors
> :compileDebugJava FAILED
> FAILURE: Build failed with an exception.
> * What went wrong:
> Execution failed for task ':compileDebugJava'.
> > Compilation failed; see the compiler error output for details.
> {code}



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-9991) resolveLocalFileSystemURL returns extra leading slash in nativeURL for some paths

2015-11-16 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-9991.
--
Resolution: Cannot Reproduce

I cannot reproduce this with cordova 5.4.0 and cordova-plugin-file 3.0.0 
targeting an iOS 9 device. No matter what I do I see only the expected 3 
slashes in the file:///var/mobile/... URL.

I don't see any recent changes in the file plugin iOS code that might have 
fixed this, but maybe there was something. Anyway if you can reproduce this 
with the latest version of cordova and the file plugin then please reactivate 
the issue with more details.

> resolveLocalFileSystemURL returns extra leading slash in nativeURL for some 
> paths
> -
>
> Key: CB-9991
> URL: https://issues.apache.org/jira/browse/CB-9991
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: cordova 5.3.3
> cordova ios 3.9.1
> cordova-plugin-file 2.0.0
> iOS
>Reporter: Denis Babineau
>  Labels: Triaged, easyfix, iOS
>
> The following:
> window.resolveLocalFileSystemURL(cordova.file.applicationDirectory, 
> function(e) { console.log("OK:", e); }, function(e) { console.log("ERR:", e); 
> });
> returns an object with nativeURL that looks like this (notice the 4 slashes 
> past the protocol, should be 3 slashes):
> "file:var/mobile/Containers/Bundle/Application/EC6F4A71-B8A8-4156-A43B-C7CB4F39FA19/Test.app/"
> I narrowed it down to CDVLocalFilesystem.m's filesystemPathForFullPath 
> implementation not handling extra leading slashes properly when fsRoot == '/':
> - (NSString *)filesystemPathForFullPath:(NSString *)fullPath
> {
> NSString *path = nil;
> NSString *strippedFullPath = [self stripQueryParametersFromPath:fullPath];
> path = [NSString stringWithFormat:@"%@%@", self.fsRoot, strippedFullPath];
> if ([path length] > 1 && [path hasSuffix:@"/"]) {
>   path = [path substringToIndex:([path length]-1)];
> }
> return path;
> }



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-9110) Android 5 Using Internal Storage - Cordova File Plugin

2015-11-13 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-9110.
--
Resolution: Duplicate

Duplicate of CB-7024 and CB-9891. The problem was just fixed yesterday so the 
fix is not yet in a published version.

> Android 5 Using Internal Storage - Cordova File Plugin
> --
>
> Key: CB-9110
> URL: https://issues.apache.org/jira/browse/CB-9110
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Camera, Plugin File
>Affects Versions: 3.5.0
> Environment: Android
>Reporter: Dan Cornish
>  Labels: Android
> Attachments: TestCordovaApp.zip
>
>
> I'm using a Samsung Galaxy S6 (Android 5) for testing.  fileEntry.file 
> failing only when using "Internal Storage" to select an image.  If I use the 
> "Gallery" or "Images", it works correctly.  
> Please see below for code snippet.
> Thanks
> {code:javascript}
> navigator.camera.getPicture(
> function (imageURI) {
> window.resolveLocalFileSystemURL(
> imageURI,
> function (fileEntry) {
> //THIS LINE IS WHERE IT'S FAILING BUT ONLY WHEN USING THE 
> "INTERNAL STORAGE" OPTION FOR SELECTING A FILE
> fileEntry.file(function (myFile) {
> console.log("SUCCESS");
> },
> function (error) {
> console.log("FAIL");
> });
> },
> function () { });
> },
> function () { },
> {
> quality: 50,
> destinationType: navigator.camera.DestinationType.FILE_URI,
> sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY
> });
> {code}



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-9986) window.file on windows platform undefined

2015-11-12 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-9986.
--
Resolution: Duplicate
  Assignee: Jason Ginchereau  (was: Jesse MacFadyen)

Duplicate of CB-9887, already fixed but not yet released. There will be an 
updated plugins release available soon.

> window.file on windows platform undefined
> -
>
> Key: CB-9986
> URL: https://issues.apache.org/jira/browse/CB-9986
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
> Environment: Visual Studio Community 2015, Visual Studio Community 
> 2015 Update 1 (RC)
>Reporter: Pavel
>Assignee: Jason Ginchereau
>Priority: Blocker
>  Labels: path, windows
>
> I've tried to use the plugin on Windows 8.1 and Windows 10 (UWP) and I get 
> the same problems every time.
> When the plugins are loaded, cordova.file/window.file is undefined , however 
> I can overcome this issue with cordova.require function - which gives me the 
> file object. 
> But even by doing so, I don't get the file paths which declared in the 
> documentation such as: cordova.file.dataDirectoryand others.
> That's how I'm overcoming this issue right now:
> if (!window.file) {
> window.file = cordova.require("cordova-plugin-file.FileProxy");
> window.file.requestAllPaths(function (paths) {
> for (var path in paths) {
> window.file[path] = paths[path];
> }
> ready();
> });
> }
> I got this code which runs fine on Android and IOS using angular:
>   $cordovaFile.createDir(window.file.dataDirectory, directoryName, 
> false).then(function (data) {
> return true;
> },
> function (error) {
> console.log("createParentDirectoryfaild");
> return false;
> });
> this code fails on Windows platform - cause window.file is undefined



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-9986) window.file on windows platform undefined

2015-11-12 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-9986:
--

Also note that window.file is not automatically defined on any platform as far 
as I know. The expected way to access the platform-specific directories is via 
cordova.file.

> window.file on windows platform undefined
> -
>
> Key: CB-9986
> URL: https://issues.apache.org/jira/browse/CB-9986
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
> Environment: Visual Studio Community 2015, Visual Studio Community 
> 2015 Update 1 (RC)
>Reporter: Pavel
>Assignee: Jason Ginchereau
>Priority: Blocker
>  Labels: path, windows
>
> I've tried to use the plugin on Windows 8.1 and Windows 10 (UWP) and I get 
> the same problems every time.
> When the plugins are loaded, cordova.file/window.file is undefined , however 
> I can overcome this issue with cordova.require function - which gives me the 
> file object. 
> But even by doing so, I don't get the file paths which declared in the 
> documentation such as: cordova.file.dataDirectoryand others.
> That's how I'm overcoming this issue right now:
> if (!window.file) {
> window.file = cordova.require("cordova-plugin-file.FileProxy");
> window.file.requestAllPaths(function (paths) {
> for (var path in paths) {
> window.file[path] = paths[path];
> }
> ready();
> });
> }
> I got this code which runs fine on Android and IOS using angular:
>   $cordovaFile.createDir(window.file.dataDirectory, directoryName, 
> false).then(function (data) {
> return true;
> },
> function (error) {
> console.log("createParentDirectoryfaild");
> return false;
> });
> this code fails on Windows platform - cause window.file is undefined



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-7024) Cordova resolveLocalFileSystemURL works but then fileEntry.file() fails

2015-11-12 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-7024.
--
Resolution: Fixed

Resolving this because the duplicate bug CB-9891 was fixed.

> Cordova resolveLocalFileSystemURL works but then fileEntry.file() fails
> ---
>
> Key: CB-7024
> URL: https://issues.apache.org/jira/browse/CB-7024
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Camera, Plugin File
>Affects Versions: 3.0.0, 3.1.0, 3.2.0, 3.3.0, 3.4.0, 3.5.0
> Environment: Android
>Reporter: DotNetWise
>Assignee: Jason Ginchereau
>  Labels: Android
>   Original Estimate: 8m
>  Remaining Estimate: 8m
>
> First, you do a {{navigator.camera.getPicture(uploadPicture_step1, 
> uploadError, chooseOptions);}}
> with success and then you do {{window.resolveLocalFileSystemURL(fileURI, 
> function (fileEntry) {})}}
> again with success.
> Now if you call that {{fileEntry.file(function(info) {}, function(err) { 
> });}} you always get an exception and the error callback is called with 
> {{err.code = 1000}};
> The error in {{logcat}} is missing {{android.permission.MANAGE_DOCUMENTS}}
> That is stuppid! It's a bug.
> I cannot get the mime-Type for the given fileEntry, so how am I supposed to 
> upload it via FileTransfer plugin (as it asks explicitely for it - to send it 
> as ContentType to the server - that's another stuppid thing, it should detect 
> it if I pass null in the firs place anways).
> This issue is for the files that are comming from custom providers such as 
> "downloads". e.g. 
> {{content://document/primary%3ADownload/11june.pdf}}
> In config.xml I do have 
> {code}
>  value="files,files-external,documents,sdcard,cache,cache-external,root" />
> 
> 
> 
>   
>   
>  value="org.apache.cordova.filetransfer.FileTransfer" />
>   
> 
>  value="org.apache.cordova.camera.CameraLauncher" />
>   
> {code}
> In {{AndroidManifest.xml}} I do have 
> {code}
> 
> {code}  
> Here are some logs
> {code}
> E/DatabaseUtils(24425): java.lang.SecurityException: Permission Denial: 
> reading com.android.externalstorage.ExternalStorageProvider uri conten
> nts/document/primary%3ADownload/11june.pdf from pid=22853, uid=10197 requires 
> android.permission.MANAGE_DOCUMENTS, or grantUriPermission()
> E/DatabaseUtils(24425): at 
> android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:467)
> E/DatabaseUtils(24425): at 
> android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:394)
> E/DatabaseUtils(24425): at 
> android.content.ContentProvider$Transport.query(ContentProvider.java:194)
> E/DatabaseUtils(24425): at 
> android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
> E/DatabaseUtils(24425): at 
> android.os.Binder.execTransact(Binder.java:404)
> E/DatabaseUtils(24425): at dalvik.system.NativeStart.run(Native 
> Method)
> W/System.err(22853): java.lang.SecurityException: Permission Denial: reading 
> com.android.externalstorage.ExternalStorageProvider uri content:/
> /document/primary%3ADownload/11june.pdf from pid=22853, uid=10197 requires 
> android.permission.MANAGE_DOCUMENTS, or grantUriPermission()
> W/System.err(22853):at android.os.Parcel.readException(Parcel.java:1465)
> W/System.err(22853):at 
> android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
> W/System.err(22853):at 
> android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
> W/System.err(22853):at 
> android.content.ContentProviderProxy.query(ContentProviderNative.java:413)
> W/System.err(22853):at 
> android.content.ContentResolver.query(ContentResolver.java:461)
> W/System.err(22853):at 
> android.content.ContentResolver.query(ContentResolver.java:404)
> W/System.err(22853):at 
> org.apache.cordova.file.ContentFilesystem.openCursorForURL(ContentFilesystem.java:258)
> W/System.err(22853):at 
> org.apache.cordova.file.ContentFilesystem.getFileMetadataForLocalURL(ContentFilesystem.java:169)
> W/System.err(22853):at 
> org.apache.cordova.file.FileUtils.getFileMetadata(FileUtils.java:811)
> W/System.err(22853):at 
> org.apache.cordova.file.FileUtils.access$400(FileUtils.java:52)
> W/System.err(22853):at 
> org.apache.cordova.file.FileUtils$14.run(FileUtils.java:383)
> W/System.err(22853):at 
> org.apache.cordova.file.FileUtils$24.run(FileUtils.java:540)
> W/System.err(22853):at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
> W/System.err(22853):at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
> W/System.err(22853):at java.lang.Thread.run(Thread.java:841)
> 

[jira] [Resolved] (CB-9891) Inconsistent URI encoding causing permission errors on android

2015-11-12 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-9891.
--
Resolution: Fixed

> Inconsistent URI encoding causing permission errors on android
> --
>
> Key: CB-9891
> URL: https://issues.apache.org/jira/browse/CB-9891
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Camera, Plugin File
>Affects Versions: 2.1.0, 3.0.0
> Environment: Android 5+
>Reporter: Connor Pearson
>Assignee: Jason Ginchereau
>  Labels: Android, reproduced
>
> Using the camera plugin to get a picture from the photo library returns an 
> encoded URI. If you then call resolveLocalFileSystemURI the fileEntry object 
> returned contains the decoded path component of the URI. This path property 
> is used in the toInternalURL function which means it's also decoded. Because 
> Android gave us permission to the encoded URI, but not the decoded URI, 
> attempting to access the decoded URI results in a permission error. 
> {code:javascript}
> document.getElementById("myButton").addEventListener("click", function(){
> navigator.camera.getPicture(function(uri){
> console.log(uri); 
> //content://com.android.providers.media.documents/document/image%3A27 
>   window.resolveLocalFileSystemURI(uri, function(fileEntry){
> console.log(fileEntry.toInternalURL()); 
> //cdvfile://localhost/content/com.android.providers.media.documents/document/image:27
>   
> fileEntry.file(function(){alert("success");}, 
> function(){alert("fail");});
> },function(error){
> // resolved by pulling in PR 119
> alert("Fail resolveFileSystemURI code: " + error.code);
> });
> }, null, {sourceType: 0, allowEdit: false});
> });
> {code}
> I feel like something must be wrong in one of the plugins, but I'm not sure 
> where.
> One possible fix is calling uri.getEncodedPath() instead of uri.getPath in 
> LocalFileSystemURL.parse and then removing the call to encodeURI() from 
> FileSystem.js, but I'm not sure if this is the right strategy. 
> [Example|https://github.com/cjpearson/cordova-plugin-file/commit/b1b9a5f9f5940223c443be5418f86dbea75106f5]



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-6683) WP8 Contact Proxy loaded on BB10

2015-11-11 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-6683?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-6683:
-
Labels: BlackBerry10  (was: blackberry)

> WP8 Contact Proxy loaded on BB10
> 
>
> Key: CB-6683
> URL: https://issues.apache.org/jira/browse/CB-6683
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Contacts
>Reporter: Bryan Higgins
>Priority: Blocker
>  Labels: BlackBerry10
>
> Contacts tests are failing on BB10 due to WP8 proxy being loaded



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-7024) Cordova resolveLocalFileSystemURL works but then fileEntry.file() fails

2015-11-11 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-7024:
--

CB-9891 is a duplicate of this one. I submitted PR for that here: 
https://github.com/apache/cordova-plugin-file/pull/148

> Cordova resolveLocalFileSystemURL works but then fileEntry.file() fails
> ---
>
> Key: CB-7024
> URL: https://issues.apache.org/jira/browse/CB-7024
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Camera, Plugin File
>Affects Versions: 3.0.0, 3.1.0, 3.2.0, 3.3.0, 3.4.0, 3.5.0
> Environment: Android
>Reporter: DotNetWise
>  Labels: Android
>   Original Estimate: 8m
>  Remaining Estimate: 8m
>
> First, you do a {{navigator.camera.getPicture(uploadPicture_step1, 
> uploadError, chooseOptions);}}
> with success and then you do {{window.resolveLocalFileSystemURL(fileURI, 
> function (fileEntry) {})}}
> again with success.
> Now if you call that {{fileEntry.file(function(info) {}, function(err) { 
> });}} you always get an exception and the error callback is called with 
> {{err.code = 1000}};
> The error in {{logcat}} is missing {{android.permission.MANAGE_DOCUMENTS}}
> That is stuppid! It's a bug.
> I cannot get the mime-Type for the given fileEntry, so how am I supposed to 
> upload it via FileTransfer plugin (as it asks explicitely for it - to send it 
> as ContentType to the server - that's another stuppid thing, it should detect 
> it if I pass null in the firs place anways).
> This issue is for the files that are comming from custom providers such as 
> "downloads". e.g. 
> {{content://document/primary%3ADownload/11june.pdf}}
> In config.xml I do have 
> {code}
>  value="files,files-external,documents,sdcard,cache,cache-external,root" />
> 
> 
> 
>   
>   
>  value="org.apache.cordova.filetransfer.FileTransfer" />
>   
> 
>  value="org.apache.cordova.camera.CameraLauncher" />
>   
> {code}
> In {{AndroidManifest.xml}} I do have 
> {code}
> 
> {code}  
> Here are some logs
> {code}
> E/DatabaseUtils(24425): java.lang.SecurityException: Permission Denial: 
> reading com.android.externalstorage.ExternalStorageProvider uri conten
> nts/document/primary%3ADownload/11june.pdf from pid=22853, uid=10197 requires 
> android.permission.MANAGE_DOCUMENTS, or grantUriPermission()
> E/DatabaseUtils(24425): at 
> android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:467)
> E/DatabaseUtils(24425): at 
> android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:394)
> E/DatabaseUtils(24425): at 
> android.content.ContentProvider$Transport.query(ContentProvider.java:194)
> E/DatabaseUtils(24425): at 
> android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
> E/DatabaseUtils(24425): at 
> android.os.Binder.execTransact(Binder.java:404)
> E/DatabaseUtils(24425): at dalvik.system.NativeStart.run(Native 
> Method)
> W/System.err(22853): java.lang.SecurityException: Permission Denial: reading 
> com.android.externalstorage.ExternalStorageProvider uri content:/
> /document/primary%3ADownload/11june.pdf from pid=22853, uid=10197 requires 
> android.permission.MANAGE_DOCUMENTS, or grantUriPermission()
> W/System.err(22853):at android.os.Parcel.readException(Parcel.java:1465)
> W/System.err(22853):at 
> android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
> W/System.err(22853):at 
> android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
> W/System.err(22853):at 
> android.content.ContentProviderProxy.query(ContentProviderNative.java:413)
> W/System.err(22853):at 
> android.content.ContentResolver.query(ContentResolver.java:461)
> W/System.err(22853):at 
> android.content.ContentResolver.query(ContentResolver.java:404)
> W/System.err(22853):at 
> org.apache.cordova.file.ContentFilesystem.openCursorForURL(ContentFilesystem.java:258)
> W/System.err(22853):at 
> org.apache.cordova.file.ContentFilesystem.getFileMetadataForLocalURL(ContentFilesystem.java:169)
> W/System.err(22853):at 
> org.apache.cordova.file.FileUtils.getFileMetadata(FileUtils.java:811)
> W/System.err(22853):at 
> org.apache.cordova.file.FileUtils.access$400(FileUtils.java:52)
> W/System.err(22853):at 
> org.apache.cordova.file.FileUtils$14.run(FileUtils.java:383)
> W/System.err(22853):at 
> org.apache.cordova.file.FileUtils$24.run(FileUtils.java:540)
> W/System.err(22853):at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
> W/System.err(22853):at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
> W/System.err(22853):at 

[jira] [Assigned] (CB-7024) Cordova resolveLocalFileSystemURL works but then fileEntry.file() fails

2015-11-11 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau reassigned CB-7024:


Assignee: Jason Ginchereau

> Cordova resolveLocalFileSystemURL works but then fileEntry.file() fails
> ---
>
> Key: CB-7024
> URL: https://issues.apache.org/jira/browse/CB-7024
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Camera, Plugin File
>Affects Versions: 3.0.0, 3.1.0, 3.2.0, 3.3.0, 3.4.0, 3.5.0
> Environment: Android
>Reporter: DotNetWise
>Assignee: Jason Ginchereau
>  Labels: Android
>   Original Estimate: 8m
>  Remaining Estimate: 8m
>
> First, you do a {{navigator.camera.getPicture(uploadPicture_step1, 
> uploadError, chooseOptions);}}
> with success and then you do {{window.resolveLocalFileSystemURL(fileURI, 
> function (fileEntry) {})}}
> again with success.
> Now if you call that {{fileEntry.file(function(info) {}, function(err) { 
> });}} you always get an exception and the error callback is called with 
> {{err.code = 1000}};
> The error in {{logcat}} is missing {{android.permission.MANAGE_DOCUMENTS}}
> That is stuppid! It's a bug.
> I cannot get the mime-Type for the given fileEntry, so how am I supposed to 
> upload it via FileTransfer plugin (as it asks explicitely for it - to send it 
> as ContentType to the server - that's another stuppid thing, it should detect 
> it if I pass null in the firs place anways).
> This issue is for the files that are comming from custom providers such as 
> "downloads". e.g. 
> {{content://document/primary%3ADownload/11june.pdf}}
> In config.xml I do have 
> {code}
>  value="files,files-external,documents,sdcard,cache,cache-external,root" />
> 
> 
> 
>   
>   
>  value="org.apache.cordova.filetransfer.FileTransfer" />
>   
> 
>  value="org.apache.cordova.camera.CameraLauncher" />
>   
> {code}
> In {{AndroidManifest.xml}} I do have 
> {code}
> 
> {code}  
> Here are some logs
> {code}
> E/DatabaseUtils(24425): java.lang.SecurityException: Permission Denial: 
> reading com.android.externalstorage.ExternalStorageProvider uri conten
> nts/document/primary%3ADownload/11june.pdf from pid=22853, uid=10197 requires 
> android.permission.MANAGE_DOCUMENTS, or grantUriPermission()
> E/DatabaseUtils(24425): at 
> android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:467)
> E/DatabaseUtils(24425): at 
> android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:394)
> E/DatabaseUtils(24425): at 
> android.content.ContentProvider$Transport.query(ContentProvider.java:194)
> E/DatabaseUtils(24425): at 
> android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
> E/DatabaseUtils(24425): at 
> android.os.Binder.execTransact(Binder.java:404)
> E/DatabaseUtils(24425): at dalvik.system.NativeStart.run(Native 
> Method)
> W/System.err(22853): java.lang.SecurityException: Permission Denial: reading 
> com.android.externalstorage.ExternalStorageProvider uri content:/
> /document/primary%3ADownload/11june.pdf from pid=22853, uid=10197 requires 
> android.permission.MANAGE_DOCUMENTS, or grantUriPermission()
> W/System.err(22853):at android.os.Parcel.readException(Parcel.java:1465)
> W/System.err(22853):at 
> android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
> W/System.err(22853):at 
> android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
> W/System.err(22853):at 
> android.content.ContentProviderProxy.query(ContentProviderNative.java:413)
> W/System.err(22853):at 
> android.content.ContentResolver.query(ContentResolver.java:461)
> W/System.err(22853):at 
> android.content.ContentResolver.query(ContentResolver.java:404)
> W/System.err(22853):at 
> org.apache.cordova.file.ContentFilesystem.openCursorForURL(ContentFilesystem.java:258)
> W/System.err(22853):at 
> org.apache.cordova.file.ContentFilesystem.getFileMetadataForLocalURL(ContentFilesystem.java:169)
> W/System.err(22853):at 
> org.apache.cordova.file.FileUtils.getFileMetadata(FileUtils.java:811)
> W/System.err(22853):at 
> org.apache.cordova.file.FileUtils.access$400(FileUtils.java:52)
> W/System.err(22853):at 
> org.apache.cordova.file.FileUtils$14.run(FileUtils.java:383)
> W/System.err(22853):at 
> org.apache.cordova.file.FileUtils$24.run(FileUtils.java:540)
> W/System.err(22853):at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
> W/System.err(22853):at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
> W/System.err(22853):at java.lang.Thread.run(Thread.java:841)
> {code}



--
This message was sent by 

[jira] [Resolved] (CB-9965) Null pointer exception calling resolveLocalFileSystemURI on image from photos

2015-11-11 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-9965.
--
Resolution: Fixed

Resolving because the PR was accepted, and I have personally verified that the 
fix works.

> Null pointer exception calling resolveLocalFileSystemURI on image from photos
> -
>
> Key: CB-9965
> URL: https://issues.apache.org/jira/browse/CB-9965
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 2.1.0, 3.0.0
> Environment: Android 5+
>Reporter: Connor Pearson
>Assignee: Joe Bowser
>  Labels: Android
>
> Calling resolveLocalFileSystemURI on an image returned from Photos library 
> (using camera plugin) on android lollipop triggers a 1000 error code.
> Debugging the application shows that this is caused by a null pointer 
> exception.
> Example code:
> {code:javascript}
> document.getElementById("myButton").addEventListener("click", function(){
>   navigator.camera.getPicture(function(uri){
>   console.log(uri); 
> //content://com.android.providers.media.documents/document/image%3A27
>   window.resolveLocalFileSystemURI(uri, function(fileEntry){
>   alert("success");
>   },function(error){
>   alert("Fail resolveFileSystemURI code: " + error.code);
>   });
>   }, null, {sourceType: 0, allowEdit: false});
>   });
> {code}



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Closed] (CB-9965) Null pointer exception calling resolveLocalFileSystemURI on image from photos

2015-11-11 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau closed CB-9965.

Assignee: (was: Joe Bowser)

> Null pointer exception calling resolveLocalFileSystemURI on image from photos
> -
>
> Key: CB-9965
> URL: https://issues.apache.org/jira/browse/CB-9965
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 2.1.0, 3.0.0
> Environment: Android 5+
>Reporter: Connor Pearson
>  Labels: Android
>
> Calling resolveLocalFileSystemURI on an image returned from Photos library 
> (using camera plugin) on android lollipop triggers a 1000 error code.
> Debugging the application shows that this is caused by a null pointer 
> exception.
> Example code:
> {code:javascript}
> document.getElementById("myButton").addEventListener("click", function(){
>   navigator.camera.getPicture(function(uri){
>   console.log(uri); 
> //content://com.android.providers.media.documents/document/image%3A27
>   window.resolveLocalFileSystemURI(uri, function(fileEntry){
>   alert("success");
>   },function(error){
>   alert("Fail resolveFileSystemURI code: " + error.code);
>   });
>   }, null, {sourceType: 0, allowEdit: false});
>   });
> {code}



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-9891) Inconsistent URI encoding causing permission errors on android

2015-11-11 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-9891:
--

I see where the encoding mixup is happening now and I have a fix. I'll submit a 
PR soon.

> Inconsistent URI encoding causing permission errors on android
> --
>
> Key: CB-9891
> URL: https://issues.apache.org/jira/browse/CB-9891
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Camera, Plugin File
>Affects Versions: 2.1.0, 3.0.0
> Environment: Android 5+
>Reporter: Connor Pearson
>Assignee: Jason Ginchereau
>  Labels: Android, reproduced
>
> Using the camera plugin to get a picture from the photo library returns an 
> encoded URI. If you then call resolveLocalFileSystemURI the fileEntry object 
> returned contains the decoded path component of the URI. This path property 
> is used in the toInternalURL function which means it's also decoded. Because 
> Android gave us permission to the encoded URI, but not the decoded URI, 
> attempting to access the decoded URI results in a permission error. 
> {code:javascript}
> document.getElementById("myButton").addEventListener("click", function(){
> navigator.camera.getPicture(function(uri){
> console.log(uri); 
> //content://com.android.providers.media.documents/document/image%3A27 
>   window.resolveLocalFileSystemURI(uri, function(fileEntry){
> console.log(fileEntry.toInternalURL()); 
> //cdvfile://localhost/content/com.android.providers.media.documents/document/image:27
>   
> fileEntry.file(function(){alert("success");}, 
> function(){alert("fail");});
> },function(error){
> // resolved by pulling in PR 119
> alert("Fail resolveFileSystemURI code: " + error.code);
> });
> }, null, {sourceType: 0, allowEdit: false});
> });
> {code}
> I feel like something must be wrong in one of the plugins, but I'm not sure 
> where.
> One possible fix is calling uri.getEncodedPath() instead of uri.getPath in 
> LocalFileSystemURL.parse and then removing the call to encodeURI() from 
> FileSystem.js, but I'm not sure if this is the right strategy. 
> [Example|https://github.com/cjpearson/cordova-plugin-file/commit/b1b9a5f9f5940223c443be5418f86dbea75106f5]



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-9891) Inconsistent URI encoding causing permission errors on android

2015-11-11 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-9891:
--

[~cjpearson] I don't think that calling uri.getEncodedPath() in 
LocalFileSystemURL.parse() is the right approach, because in cases of a normal 
file then we do actually want the decoded path.

In the PR I'm using a slightly different approach, which is to preserve the 
original encoding of the native URI (when there is one) in FileSystem.js.

> Inconsistent URI encoding causing permission errors on android
> --
>
> Key: CB-9891
> URL: https://issues.apache.org/jira/browse/CB-9891
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Camera, Plugin File
>Affects Versions: 2.1.0, 3.0.0
> Environment: Android 5+
>Reporter: Connor Pearson
>Assignee: Jason Ginchereau
>  Labels: Android, reproduced
>
> Using the camera plugin to get a picture from the photo library returns an 
> encoded URI. If you then call resolveLocalFileSystemURI the fileEntry object 
> returned contains the decoded path component of the URI. This path property 
> is used in the toInternalURL function which means it's also decoded. Because 
> Android gave us permission to the encoded URI, but not the decoded URI, 
> attempting to access the decoded URI results in a permission error. 
> {code:javascript}
> document.getElementById("myButton").addEventListener("click", function(){
> navigator.camera.getPicture(function(uri){
> console.log(uri); 
> //content://com.android.providers.media.documents/document/image%3A27 
>   window.resolveLocalFileSystemURI(uri, function(fileEntry){
> console.log(fileEntry.toInternalURL()); 
> //cdvfile://localhost/content/com.android.providers.media.documents/document/image:27
>   
> fileEntry.file(function(){alert("success");}, 
> function(){alert("fail");});
> },function(error){
> // resolved by pulling in PR 119
> alert("Fail resolveFileSystemURI code: " + error.code);
> });
> }, null, {sourceType: 0, allowEdit: false});
> });
> {code}
> I feel like something must be wrong in one of the plugins, but I'm not sure 
> where.
> One possible fix is calling uri.getEncodedPath() instead of uri.getPath in 
> LocalFileSystemURL.parse and then removing the call to encodeURI() from 
> FileSystem.js, but I'm not sure if this is the right strategy. 
> [Example|https://github.com/cjpearson/cordova-plugin-file/commit/b1b9a5f9f5940223c443be5418f86dbea75106f5]



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-8442) [iOS] After several (hundreds) file write operations, the plugin stops working and no error is dispatched.

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-8442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-8442:
-
Labels: iOS memory-leak  (was: iOS)

> [iOS] After several (hundreds) file write operations, the plugin stops 
> working and no error is dispatched.
> --
>
> Key: CB-8442
> URL: https://issues.apache.org/jira/browse/CB-8442
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 4.0.0
> Environment: iOS 8.1.x
> iOS PLATFORM VERSION: 3.7.0
> Simulator, iPad Mini Retina, iPhone 4, iPhone 5s
>Reporter: Andrea
>Assignee: Omar Mefire
>Priority: Critical
>  Labels: iOS, memory-leak
>
> File Plugin [version 1.3.2]
> After several (hundreds) file write operations (with arrayBuffer), the plugin 
> becomes unresponsive and no error is dispatched.
> Given a list of files, it seems it happens always at the same point ( in my 
> case after 484 write operations, or 492, or 469, etc.). I'm quite sure it's 
> not related to the type of file. No errors are returned. The plugin simply 
> stops working. I guess all the plugins become unresponsive.
> With the same number operations, but executed through FileTransfer-> 
> download, there are no problems.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-5749) App getting crash some times when i use take photo using navigator.camera.getPicture in iOS 7.0

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-5749?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-5749:
-
Labels: Triaged iOS memory-leak  (was: Triaged iOS)

> App getting crash some times when i use take photo using 
> navigator.camera.getPicture in iOS 7.0
> ---
>
> Key: CB-5749
> URL: https://issues.apache.org/jira/browse/CB-5749
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Camera
> Environment: Cordova-2.4.0, Sencha touch 2.1.1, iOS-7.0, XCode-5.0
> iOS
>Reporter: kalyani puvvada
>  Labels: Triaged, iOS, memory-leak
>
> I am getting this crash in iOS 7 only. In iOS 6 it works fine. I used the 
> following code for take photo.
> {code:javascript}
> var destinationType=navigator.camera.DestinationType;
> navigator.camera.getPicture(this.caregiverPhotoSuccess, 
> this.caregiverPhotoFail, {
>  quality: 50,
>  targetWidth:300,
>  targetHeight:300,
>  destinationType: destinationType.DATA_URL,
>  sourceType:2,
>  correctOrientation: true 
> });
> {code}
> I am getting this error when app crash.
>   Received memory warning.
>   Plugin 'CDVCamera' has a pending operation, memory purge is delayed for 
> didReceiveMemoryWarning.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-5883) navigation.camera.getPicture() crashing on iOS 7 and iPhone 4S

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-5883?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-5883:
-
Labels: iOS memory-leak  (was: )

> navigation.camera.getPicture() crashing on iOS 7 and iPhone 4S
> --
>
> Key: CB-5883
> URL: https://issues.apache.org/jira/browse/CB-5883
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Camera
>Affects Versions: 3.3.0
> Environment: iPhone 4S, iOS 7.0.4, 
>Reporter: Michał Letyński
>  Labels: iOS, memory-leak
>
> I have same problem as here:
> https://issues.apache.org/jira/browse/CB-391
> My app is being crashed after camera.getPicture(). It work fine with iPhone 
> 5/5s.
> Can i somehow provide you more info ? Dump something from my phone ?



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-7873) [iOS 8] Memory accretion issue

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7873?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-7873:
-
Labels: memory-leak  (was: )

> [iOS 8] Memory accretion issue
> --
>
> Key: CB-7873
> URL: https://issues.apache.org/jira/browse/CB-7873
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: iOS
>Affects Versions: Master
> Environment: iOS 8
>Reporter: Shazron Abdullah
>Assignee: Shazron Abdullah
>  Labels: memory-leak
> Attachments: memory-accretion.png
>
>
> See https://github.com/ModusCreateOrg/phonegap-ios8-memory for description 
> and test project.
> See attached image.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-8332) Memory leak in loading files from disk with file plugin

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-8332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-8332:
-
Labels: iOS memory-leak  (was: iOS)

> Memory leak in loading files from disk with file plugin
> ---
>
> Key: CB-8332
> URL: https://issues.apache.org/jira/browse/CB-8332
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 3.5.0
> Environment: iOS
>Reporter: Patrick Richards
>Assignee: Shazron Abdullah
>  Labels: iOS, memory-leak
>
> When loading files from disk, the file plugin appears to leak memory. Using 
> instruments it can be narrowed down to -[CDVFilesystemURLProtocol 
> startLoading], which is in CDVFile.m on line 150.
> (https://github.com/apache/cordova-plugin-file/blob/967ca4d848d6bea0bad5a0d334b8d9f1ea2c4680/src/ios/CDVFile.m#L150)
> To reproduce:
> • have the iOS app download a file using plugin-file-transfer
> • store that file to persistent storage
> • load that file from disk and the app will leak
> We have a very simple proof of concept that downloads a large photo, then 
> constantly refreshes an iFrame which triggers loading the photo from 
> persistent storage. The memory usage of the app climbs over time (with 
> various dips at memory warnings), then crashes due to memory pressure. We can 
> upload this sample project/provide a link if needed – there doesn’t appear to 
> be a way to attach files.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-8669) Always use setters to fix memory issues without ARC

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-8669?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-8669:
-
Labels: iOS memory-leak  (was: iOS)

> Always use setters to fix memory issues without ARC
> ---
>
> Key: CB-8669
> URL: https://issues.apache.org/jira/browse/CB-8669
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Reporter: Olivier Louvignes
>  Labels: iOS, memory-leak
>
> https://github.com/apache/cordova-plugin-file/pull/104
> Encountered memory issues with a non-ARC project (cordova+unity3d). Setter 
> should be used to prevent memory issues, eg:
> A synthesized retained setter looks like :
> {code}
> - (void)setValue: (id)newValue
> {
> if (value != newValue)
> {
> [value release];
> value = newValue;
> [value retain];
> }
> } 
> {code}



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-9652) Cordova File plugin memory leaking

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9652?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-9652:
-
Labels: iOS memory-leak  (was: iOS)

> Cordova File plugin memory leaking
> --
>
> Key: CB-9652
> URL: https://issues.apache.org/jira/browse/CB-9652
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 3.5.0
>Reporter: Gregor
>  Labels: iOS, memory-leak
>
> We are creating apps using Ionicframework, then building them using cordova. 
> What we are doing in our app is taking photos using Cordova Camera, then 
> moving the files to specific directory. The user has an ability to upload all 
> photos taken to server. Here is how the user progresses through the app:
> 1. Make Photo using Cordova Camera. 
> 2. Use Cordova File to move created file using step 1 to other location.
> 3. Repeat process 1&2 several times (20 times approx).
> 4. Start sync process
> 5. $http requests start (synchronous, not asynchronous!)
> 5.1. Read data from File as base64 string (using Cordova File plugin)
> 5.2. Send data to server
> 5.3. On success, use Cordova File to delete photo from device.
> This was tested on:
> - iPad mini (ios 8, uiwebview)
> - iPad 4 (ios 8, uiwebview)
> We've debugged the whole process through Xcode and checked how memory 
> management is doing. The results were catastrophic!
> - After each File.moveTo call, the app memory grew for at least 5MB.
> - After each File.readAsDataUrl call, the app memory grew for at least 5MB.
> - After each File.removeFile call, the app memory grew for at least 5MB.
> {quote}
> 015-09-02 09:00:03.487 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '84140.372803' ms. Plugin should use a background thread.
> 2015-09-02 09:00:51.925 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '11.680908' ms. Plugin should use a background thread.
> 2015-09-02 09:00:58.376 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '11.557861' ms. Plugin should use a background thread.
> 2015-09-02 09:01:12.505 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '12.233887' ms. Plugin should use a background thread.
> 2015-09-02 09:01:26.748 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '11.616943' ms. Plugin should use a background thread.
> 2015-09-02 09:01:33.780 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '11.599121' ms. Plugin should use a background thread.
> 2015-09-02 09:01:54.696 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '11.628174' ms. Plugin should use a background thread.
> 2015-09-02 09:02:01.838 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '11.617920' ms. Plugin should use a background thread.
> 2015-09-02 09:02:08.800 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '13.183105' ms. Plugin should use a background thread.
> 2015-09-02 09:02:15.660 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '11.779053' ms. Plugin should use a background thread.
> 2015-09-02 09:02:29.399 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '10.287842' ms. Plugin should use a background thread.
> 2015-09-02 09:02:43.206 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '11.649170' ms. Plugin should use a background thread.
> 2015-09-02 09:02:50.500 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '11.527100' ms. Plugin should use a background thread.
> 2015-09-02 09:02:57.189 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '11.545166' ms. Plugin should use a background thread.
> 2015-09-02 09:03:03.999 test_app[1409:279018] THREAD WARNING: ['File'] took 
> '11.493164' ms. Plugin should use a background thread.
> 2015-09-02 09:03:15.452 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:19.132 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:20.488 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:20.527 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:20.556 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:20.584 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:20.610 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:24.390 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:24.408 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:26.034 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:26.489 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:26.509 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:26.529 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:26.549 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:26.570 test_app[1409:279018] Received memory warning.
> 2015-09-02 09:03:26.601 test_app[1409:279018] Received memory warning.
> 

[jira] [Updated] (CB-6629) App crashed with file function

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-6629?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-6629:
-
Labels: memory-leak  (was: )

> App crashed with file function
> --
>
> Key: CB-6629
> URL: https://issues.apache.org/jira/browse/CB-6629
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 3.4.0
> Environment: Android
>Reporter: alpg 78
>Assignee: Ian Clelland
>  Labels: memory-leak
>
> When i try to use this code :
> {code}
> window.requestFileSystem = window.requestFileSystem || 
> window.webkitRequestFileSystem;
> window.LocalFileSystem = window.LocalFileSystem || {PERSISTENT: 
> window.PERSISTENT};
> window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
> function gotFS(fileSystem) {
> fileSystem.root.getDirectory("DO_NOT_DELETE", 
> {create: true, exclusive: false}, 
> gotDirEntry, 
> fail);
> }
> function gotDirEntry(dirEntry) {
> dir = dirEntry;
> dirEntry.getFile("sample.json", 
> {create: false, exclusive: false}, 
> readSuccess, 
> fileDonotexist);
> }
> function fileDonotexist(dirEntry) {
> dir.getFile("sample.json", 
> {create: true, exclusive: false}, 
> gotFileEntry, 
> fail);
> }
> function gotFileEntry(fileEntryWrite) {
> fileEntryWrite.createWriter(gotFileWriter, fail);
> }
> function gotFileWriter(writer) {
> writer.onerror = function(evt) {
> };
> writer.write(localData);
> writer.onwriteend = function(evt) {
> dir.getFile("sample.json", 
> {create: false, exclusive: false}, 
> readSuccess, 
> fail);
> };
> }
> function readSuccess(fileE) {
> fileE.file(readAsText, fail);
> }
> function fail(error) {
> alert("fail");
> }
> function readAsText(readerDummy) {
> var reader = new FileReader();
> reader.onloadstart = function(evt) {};
> reader.onprogress = function(evt) {};
> reader.onerror = function(evt) {};
> reader.onloadend = function(evt) {
> console.log("read success");
> };
> reader.readAsText(readerDummy);
> }
> {code}
> my app crashed and she is turning off. what's wrong ?



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-8002) Creating a new div for every Js -> Native exec() call

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-8002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-8002:
-
Labels: memory-leak  (was: )

> Creating a new div for every Js -> Native exec() call
> -
>
> Key: CB-8002
> URL: https://issues.apache.org/jira/browse/CB-8002
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: iOS
>Affects Versions: 3.7.0
> Environment: Tested on multiple iOS 8.1 devices, simulators
>Reporter: Serdar Onal
>Assignee: Andrew Grieve
>Priority: Critical
>  Labels: memory-leak
> Fix For: 3.8.0
>
>
> Since the 3.7.0 update, when cordova does a Js to Native call using exec(), 
> somehow the underlying cordova.js is creating a "gap://ready" iframe on every 
> call. This means that if you made 1000 native calls you'll have 1000 divs on 
> the DOM.
> I believe this issue is of critical priority as it incurs a huge memory leak.
> Screenshot from safari inspector
> https://drive.google.com/file/d/0B94TXiq5ycp1anp6aGpTbjhPdG8/view?usp=sharing



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-7415) File plugin's ProgressEvent implementation overwrites browser's native implementation

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7415?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-7415:
-
Issue Type: Improvement  (was: Bug)

> File plugin's ProgressEvent implementation overwrites browser's native 
> implementation
> -
>
> Key: CB-7415
> URL: https://issues.apache.org/jira/browse/CB-7415
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Plugin File
>Affects Versions: 3.5.0, 3.6.0
>Reporter: James White
>  Labels: Triaged
>
> The File plugin includes ProgressEvent.js, an implementation that mimics 
> ProgressEvent objects for the FileReader/FileWriter objects, but does not 
> include the usual event methods, etc.  
> When the File plugin is added to a project, any existing ProgressEvent 
> implementation native to the browser environment is overwritten with this 
> one, breaking code outside of the plugin that relies on ProgressEvent 
> functionality.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-7415) File plugin's ProgressEvent implementation overwrites browser's native implementation

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7415?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-7415:
-
Labels: Triaged  (was: )

> File plugin's ProgressEvent implementation overwrites browser's native 
> implementation
> -
>
> Key: CB-7415
> URL: https://issues.apache.org/jira/browse/CB-7415
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Plugin File
>Affects Versions: 3.5.0, 3.6.0
>Reporter: James White
>  Labels: Triaged
>
> The File plugin includes ProgressEvent.js, an implementation that mimics 
> ProgressEvent objects for the FileReader/FileWriter objects, but does not 
> include the usual event methods, etc.  
> When the File plugin is added to a project, any existing ProgressEvent 
> implementation native to the browser environment is overwritten with this 
> one, breaking code outside of the plugin that relies on ProgressEvent 
> functionality.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-7120) File incompatible with XHR2 FormData

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-7120:
-
Labels: Triaged  (was: )

> File incompatible with XHR2 FormData
> 
>
> Key: CB-7120
> URL: https://issues.apache.org/jira/browse/CB-7120
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Plugin File
>Affects Versions: 3.5.0
> Environment: Android 4.4.2
>Reporter: Morgan Allen
>  Labels: Triaged
>
> Scenario.
> Using the Camera API to load a File (from FileEntry)
> Upload File using angular-file-upload
> Which uses FormData to upload via XHR
> I haven't had time to boil this down to a test case yet but here is what I 
> have.
> {code:title=File Input Request Payload}
> --WebKitFormBoundary8InTUnt3DiGk5CgN
> Content-Disposition: form-data; name="file"; filename="AngularJS-large.png"
> Content-Type: image/png
> --WebKitFormBoundary8InTUnt3DiGk5CgN--
> {code}
> {code:title=Phonegap File Request Payload}
> --WebKitFormBoundaryfFYuBlWwlPwVCVzp
> Content-Disposition: form-data; name="file"
> [object Object]
> --WebKitFormBoundaryfFYuBlWwlPwVCVzp--
> Response Headersview source
> {code}
> And inspecting each object shows the Phonegap File is not derived from a Blob 
> as the browser implementation is.
> {code:title=FormData.append API}
> void append(DOMString name, File value, optional DOMString filename);
> void append(DOMString name, Blob value, optional DOMString filename);
> void append(DOMString name, DOMString value);
> {code}
> Maybe this is causing a serialization issue?



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Comment Edited] (CB-7120) File incompatible with XHR2 FormData

2015-11-10 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau edited comment on CB-7120 at 11/10/15 11:28 PM:
-

Consider making the file plugin generally compatible with the W3C File API 
draft standard at http://www.w3.org/TR/FileAPI/. That would make it work better 
with other APIs such as XHR2 FormData that can use Files and Blobs.


was (Author: jasongin):
Consider making the file plugin generally compatible with the [W3C File API 
draft standard](http://www.w3.org/TR/FileAPI/). That would make it work better 
with other APIs such as XHR2 FormData that can use Files and Blobs.

> File incompatible with XHR2 FormData
> 
>
> Key: CB-7120
> URL: https://issues.apache.org/jira/browse/CB-7120
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Plugin File
>Affects Versions: 3.5.0
> Environment: Android 4.4.2
>Reporter: Morgan Allen
>  Labels: Triaged
>
> Scenario.
> Using the Camera API to load a File (from FileEntry)
> Upload File using angular-file-upload
> Which uses FormData to upload via XHR
> I haven't had time to boil this down to a test case yet but here is what I 
> have.
> {code:title=File Input Request Payload}
> --WebKitFormBoundary8InTUnt3DiGk5CgN
> Content-Disposition: form-data; name="file"; filename="AngularJS-large.png"
> Content-Type: image/png
> --WebKitFormBoundary8InTUnt3DiGk5CgN--
> {code}
> {code:title=Phonegap File Request Payload}
> --WebKitFormBoundaryfFYuBlWwlPwVCVzp
> Content-Disposition: form-data; name="file"
> [object Object]
> --WebKitFormBoundaryfFYuBlWwlPwVCVzp--
> Response Headersview source
> {code}
> And inspecting each object shows the Phonegap File is not derived from a Blob 
> as the browser implementation is.
> {code:title=FormData.append API}
> void append(DOMString name, File value, optional DOMString filename);
> void append(DOMString name, Blob value, optional DOMString filename);
> void append(DOMString name, DOMString value);
> {code}
> Maybe this is causing a serialization issue?



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-7120) File incompatible with XHR2 FormData

2015-11-10 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-7120:
--

Consider making the file plugin generally compatible with the [W3C File API 
draft standard](http://www.w3.org/TR/FileAPI/). That would make it work better 
with other APIs such as XHR2 FormData that can use Files and Blobs.

> File incompatible with XHR2 FormData
> 
>
> Key: CB-7120
> URL: https://issues.apache.org/jira/browse/CB-7120
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 3.5.0
> Environment: Android 4.4.2
>Reporter: Morgan Allen
>  Labels: Triaged
>
> Scenario.
> Using the Camera API to load a File (from FileEntry)
> Upload File using angular-file-upload
> Which uses FormData to upload via XHR
> I haven't had time to boil this down to a test case yet but here is what I 
> have.
> {code:title=File Input Request Payload}
> --WebKitFormBoundary8InTUnt3DiGk5CgN
> Content-Disposition: form-data; name="file"; filename="AngularJS-large.png"
> Content-Type: image/png
> --WebKitFormBoundary8InTUnt3DiGk5CgN--
> {code}
> {code:title=Phonegap File Request Payload}
> --WebKitFormBoundaryfFYuBlWwlPwVCVzp
> Content-Disposition: form-data; name="file"
> [object Object]
> --WebKitFormBoundaryfFYuBlWwlPwVCVzp--
> Response Headersview source
> {code}
> And inspecting each object shows the Phonegap File is not derived from a Blob 
> as the browser implementation is.
> {code:title=FormData.append API}
> void append(DOMString name, File value, optional DOMString filename);
> void append(DOMString name, Blob value, optional DOMString filename);
> void append(DOMString name, DOMString value);
> {code}
> Maybe this is causing a serialization issue?



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-7120) File incompatible with XHR2 FormData

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-7120:
-
Issue Type: Improvement  (was: Bug)

> File incompatible with XHR2 FormData
> 
>
> Key: CB-7120
> URL: https://issues.apache.org/jira/browse/CB-7120
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Plugin File
>Affects Versions: 3.5.0
> Environment: Android 4.4.2
>Reporter: Morgan Allen
>  Labels: Triaged
>
> Scenario.
> Using the Camera API to load a File (from FileEntry)
> Upload File using angular-file-upload
> Which uses FormData to upload via XHR
> I haven't had time to boil this down to a test case yet but here is what I 
> have.
> {code:title=File Input Request Payload}
> --WebKitFormBoundary8InTUnt3DiGk5CgN
> Content-Disposition: form-data; name="file"; filename="AngularJS-large.png"
> Content-Type: image/png
> --WebKitFormBoundary8InTUnt3DiGk5CgN--
> {code}
> {code:title=Phonegap File Request Payload}
> --WebKitFormBoundaryfFYuBlWwlPwVCVzp
> Content-Disposition: form-data; name="file"
> [object Object]
> --WebKitFormBoundaryfFYuBlWwlPwVCVzp--
> Response Headersview source
> {code}
> And inspecting each object shows the Phonegap File is not derived from a Blob 
> as the browser implementation is.
> {code:title=FormData.append API}
> void append(DOMString name, File value, optional DOMString filename);
> void append(DOMString name, Blob value, optional DOMString filename);
> void append(DOMString name, DOMString value);
> {code}
> Maybe this is causing a serialization issue?



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-9753) index out of bounds on requestFileSystem

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-9753:
-
Labels: Triaged easyfix iOS  (was: iOS)

> index out of bounds on requestFileSystem
> 
>
> Key: CB-9753
> URL: https://issues.apache.org/jira/browse/CB-9753
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: cordova 5.3.3
> cordova ios 3.9.1
> cordova-plugin-file 2.0.0
> iOS
>Reporter: Denis Babineau
>  Labels: Triaged, easyfix, iOS
>
> CDVFile.m's requestFileSystem: incorrectly checks the bounds of an array:
> if (type > self.fileSystems.count) {
> should read:
> if (type >= self.fileSystems.count) {



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-6335) Blackberry file plugin accessing file system returns no results

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-6335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-6335:
-
Priority: Minor  (was: Major)

> Blackberry file plugin accessing file system returns no results
> ---
>
> Key: CB-6335
> URL: https://issues.apache.org/jira/browse/CB-6335
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 3.4.0
> Environment: File plugin 1.0.1, Blackberry 10.2.x emulator & device 
> (Z10)
>Reporter: Boston Dell-Vandenberg
>Priority: Minor
>  Labels: BlackBerry10
>
> Trying to access the Blackberry shared folder and list it's contents but the 
> file plugin is returning no entries (FileError Code 1).
> blackberry.io.sandbox is set to false and the blackberry.io plugin is 
> installed to access the shared folder path.
> I have tested on both emulator and device (10.2) with the following code:
> {code}
> window.requestFileSystem(
>   LocalFileSystem.PERSISTENT,
>   1024 * 1024,
>   function (fs) {
>   fs.root.getDirectory(
> blackberry.io.sharedFolder,
> {},
> function(result) {
>   var reader = result.createReader();
>   reader.readEntries(
> function(entries) {
>   console.log(entries);
> },
> function (error) {
>   console.log('Failed to list directory contents: ', error);
> }
>   );
> },
> function(error) {
>   console.log('Error accessing shared folder');
> }
>   );
>   },
>   function () {
> console.log('Error accessing local file system');
>   }
> );
> {code}



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-8497) FileEntry.remove() and FileEntry.file() fail if the file has '#' in its name

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-8497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-8497:
-
Labels: Triaged  (was: )

> FileEntry.remove() and FileEntry.file() fail if the file has '#' in its name
> 
>
> Key: CB-8497
> URL: https://issues.apache.org/jira/browse/CB-8497
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: iOS 8.1.3 and Android 5.0
>Reporter: Dani Palou
>Assignee: Jason Ginchereau
>  Labels: Triaged
>
> If I try to delete a file that has the character '#' in its name, the 
> 'remove' function always fails, returning FileError.NOT_FOUND_ERR. If the 
> file doesn't have the '#' character, the code works fine. This error is 
> happening both in Android 5 and iOS 8.1.3.
> The same happens for the 'file' function.
> This is one of the FileEntries that I'm testing with:
> {quote}
> fullPath: "/tmp/test#.txt",
> isDirectory: false,
> isFIle: true,
> name: "test#.txt",
> nativeURL: "file:///storage/emulated/0/tmp/test%23.txt"
> {quote}
> I obtained this FileEntry using a DirectoryReader to read the contents of the 
> parent folder.
> I'm testing with PhoneGap CLI 4.2.0, FilePlugin 1.3.3, PhoneGap Android 3.6.4 
> and PhoneGap iOS 3.7.0.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-9891) Inconsistent URI encoding causing permission errors on android

2015-11-10 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-9891:
--

Reproduced on Android Lollipop with the following steps:
1. Use the browser on the device to download a picture.
2. Start the Cordova app and execute code similar to that in this JIRA 
description.
3. Select the downloaded picture from the gallery.

I found this exception in the logcat:

java.lang.SecurityException: Permission Denial: reading 
com.android.providers.media.MediaDocumentsProvider uri 
content://com.android.providers.media.documents/document/image:10 from 
pid=1987, uid=10052 requires android.permission.MANAGE_DOCUMENTS, or 
grantUriPermission()
at 
android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:539)
at 
android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:452)
at 
android.content.ContentProvider$Transport.query(ContentProvider.java:205)
at 
android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
at android.os.Binder.execTransact(Binder.java:446)
java.lang.SecurityException: Permission Denial: reading 
com.android.providers.media.MediaDocumentsProvider uri 
content://com.android.providers.media.documents/document/image:10 from 
pid=1987, uid=10052 requires android.permission.MANAGE_DOCUMENTS, or 
grantUriPermission()
at android.os.Parcel.readException(Parcel.java:1546)
at 
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
at 
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
at 
android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
at android.content.ContentResolver.query(ContentResolver.java:478)
at android.content.ContentResolver.query(ContentResolver.java:422)
at 
org.apache.cordova.file.ContentFilesystem.openCursorForURL(ContentFilesystem.java:169)
at 
org.apache.cordova.file.ContentFilesystem.getFileMetadataForLocalURL(ContentFilesystem.java:123)
at org.apache.cordova.file.FileUtils.getFileMetadata(FileUtils.java:875)
at org.apache.cordova.file.FileUtils.access$700(FileUtils.java:55)
at org.apache.cordova.file.FileUtils$15.run(FileUtils.java:419)
at org.apache.cordova.file.FileUtils$25.run(FileUtils.java:634)


> Inconsistent URI encoding causing permission errors on android
> --
>
> Key: CB-9891
> URL: https://issues.apache.org/jira/browse/CB-9891
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Camera, Plugin File
>Affects Versions: 2.1.0, 3.0.0
> Environment: Android 5+
>Reporter: Connor Pearson
>Assignee: Jason Ginchereau
>  Labels: Android, reproduced
>
> Using the camera plugin to get a picture from the photo library returns an 
> encoded URI. If you then call resolveLocalFileSystemURI the fileEntry object 
> returned contains the decoded path component of the URI. This path property 
> is used in the toInternalURL function which means it's also decoded. Because 
> Android gave us permission to the encoded URI, but not the decoded URI, 
> attempting to access the decoded URI results in a permission error. 
> {code:javascript}
> document.getElementById("myButton").addEventListener("click", function(){
> navigator.camera.getPicture(function(uri){
> console.log(uri); 
> //content://com.android.providers.media.documents/document/image%3A27 
>   window.resolveLocalFileSystemURI(uri, function(fileEntry){
> console.log(fileEntry.toInternalURL()); 
> //cdvfile://localhost/content/com.android.providers.media.documents/document/image:27
>   
> fileEntry.file(function(){alert("success");}, 
> function(){alert("fail");});
> },function(error){
> // resolved by pulling in PR 119
> alert("Fail resolveFileSystemURI code: " + error.code);
> });
> }, null, {sourceType: 0, allowEdit: false});
> });
> {code}
> I feel like something must be wrong in one of the plugins, but I'm not sure 
> where.
> One possible fix is calling uri.getEncodedPath() instead of uri.getPath in 
> LocalFileSystemURL.parse and then removing the call to encodeURI() from 
> FileSystem.js, but I'm not sure if this is the right strategy.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: 

[jira] [Commented] (CB-9891) Inconsistent URI encoding causing permission errors on android

2015-11-10 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-9891:
--

Working on a fix based on 
http://stackoverflow.com/questions/19837358/android-kitkat-securityexception-when-trying-to-read-from-mediastore

> Inconsistent URI encoding causing permission errors on android
> --
>
> Key: CB-9891
> URL: https://issues.apache.org/jira/browse/CB-9891
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Camera, Plugin File
>Affects Versions: 2.1.0, 3.0.0
> Environment: Android 5+
>Reporter: Connor Pearson
>Assignee: Jason Ginchereau
>  Labels: Android, reproduced
>
> Using the camera plugin to get a picture from the photo library returns an 
> encoded URI. If you then call resolveLocalFileSystemURI the fileEntry object 
> returned contains the decoded path component of the URI. This path property 
> is used in the toInternalURL function which means it's also decoded. Because 
> Android gave us permission to the encoded URI, but not the decoded URI, 
> attempting to access the decoded URI results in a permission error. 
> {code:javascript}
> document.getElementById("myButton").addEventListener("click", function(){
> navigator.camera.getPicture(function(uri){
> console.log(uri); 
> //content://com.android.providers.media.documents/document/image%3A27 
>   window.resolveLocalFileSystemURI(uri, function(fileEntry){
> console.log(fileEntry.toInternalURL()); 
> //cdvfile://localhost/content/com.android.providers.media.documents/document/image:27
>   
> fileEntry.file(function(){alert("success");}, 
> function(){alert("fail");});
> },function(error){
> // resolved by pulling in PR 119
> alert("Fail resolveFileSystemURI code: " + error.code);
> });
> }, null, {sourceType: 0, allowEdit: false});
> });
> {code}
> I feel like something must be wrong in one of the plugins, but I'm not sure 
> where.
> One possible fix is calling uri.getEncodedPath() instead of uri.getPath in 
> LocalFileSystemURL.parse and then removing the call to encodeURI() from 
> FileSystem.js, but I'm not sure if this is the right strategy.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-7127) amazon-fireos: some js files are not merged the same way as on android platform

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-7127:
-
Priority: Minor  (was: Major)

> amazon-fireos: some js files are not merged the same way as on android 
> platform
> ---
>
> Key: CB-7127
> URL: https://issues.apache.org/jira/browse/CB-7127
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 3.5.0
>Reporter: vldm
>Priority: Minor
>  Labels: FireOS
> Attachments: git.diff
>
>
> When building for platform amazon-fireos placeholder file fileSystem.js is 
> not overridden by android specific version, which makes call to 
> resolveLocalFileSystemURL return entry with null filesystem.
> The platform element of plugin.xml for amazon-fireos is different from 
> android, but probably should be the same. When I replaced section of this 
> element after comment  with content from 
> android platform the function returns entry with correct filesystem on 
> amazon-fireos.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-7127) amazon-fireos: some js files are not merged the same way as on android platform

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-7127:
-
Labels: FireOS Triaged easyfix  (was: FireOS)

> amazon-fireos: some js files are not merged the same way as on android 
> platform
> ---
>
> Key: CB-7127
> URL: https://issues.apache.org/jira/browse/CB-7127
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 3.5.0
>Reporter: vldm
>Priority: Minor
>  Labels: FireOS, Triaged, easyfix
> Attachments: git.diff
>
>
> When building for platform amazon-fireos placeholder file fileSystem.js is 
> not overridden by android specific version, which makes call to 
> resolveLocalFileSystemURL return entry with null filesystem.
> The platform element of plugin.xml for amazon-fireos is different from 
> android, but probably should be the same. When I replaced section of this 
> element after comment  with content from 
> android platform the function returns entry with correct filesystem on 
> amazon-fireos.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-9891) Inconsistent URI encoding causing permission errors on android

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-9891:
-
Labels: Android reproduced  (was: Android)

> Inconsistent URI encoding causing permission errors on android
> --
>
> Key: CB-9891
> URL: https://issues.apache.org/jira/browse/CB-9891
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Camera, Plugin File
>Affects Versions: 2.1.0, 3.0.0
> Environment: Android 5+
>Reporter: Connor Pearson
>Assignee: Jason Ginchereau
>  Labels: Android, reproduced
>
> Using the camera plugin to get a picture from the photo library returns an 
> encoded URI. If you then call resolveLocalFileSystemURI the fileEntry object 
> returned contains the decoded path component of the URI. This path property 
> is used in the toInternalURL function which means it's also decoded. Because 
> Android gave us permission to the encoded URI, but not the decoded URI, 
> attempting to access the decoded URI results in a permission error. 
> {code:javascript}
> document.getElementById("myButton").addEventListener("click", function(){
> navigator.camera.getPicture(function(uri){
> console.log(uri); 
> //content://com.android.providers.media.documents/document/image%3A27 
>   window.resolveLocalFileSystemURI(uri, function(fileEntry){
> console.log(fileEntry.toInternalURL()); 
> //cdvfile://localhost/content/com.android.providers.media.documents/document/image:27
>   
> fileEntry.file(function(){alert("success");}, 
> function(){alert("fail");});
> },function(error){
> // resolved by pulling in PR 119
> alert("Fail resolveFileSystemURI code: " + error.code);
> });
> }, null, {sourceType: 0, allowEdit: false});
> });
> {code}
> I feel like something must be wrong in one of the plugins, but I'm not sure 
> where.
> One possible fix is calling uri.getEncodedPath() instead of uri.getPath in 
> LocalFileSystemURL.parse and then removing the call to encodeURI() from 
> FileSystem.js, but I'm not sure if this is the right strategy.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-9403) File does not have fullPath property

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau resolved CB-9403.
--
Resolution: Invalid
  Assignee: (was: Murat Sutunc)

As Erik said, File is not expected to have a fullPath property. I'm resolving 
this bug as Invalid since it appears there's nothing to fix.

> File does not have fullPath property
> 
>
> Key: CB-9403
> URL: https://issues.apache.org/jira/browse/CB-9403
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Reporter: Erik Jan de Wit
>  Labels: Windows
>
> File should have a property called fullPath like FileEntry does but on 
> windows this is not the case.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-7075) BlackBerry10 filesystem URIs are inconsistent and hacky

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7075?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-7075:
-
Labels: BlackBerry10 Triaged  (was: BlackBerry10)

> BlackBerry10 filesystem URIs are inconsistent and hacky
> ---
>
> Key: CB-7075
> URL: https://issues.apache.org/jira/browse/CB-7075
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Plugin File Transfer, Plugin Media, Plugin 
> Media Capture
>Affects Versions: 3.5.0
> Environment: Windows 8.1, BlackBerry10
>Reporter: Doug Moscrop
>Priority: Minor
>  Labels: BlackBerry10, Triaged
>
> (sorry for the Component/s spam but it's the pieces involved)
> 1. Record an audio clip using media-capture
> 2. Play the audio clip using the media
> 3. Upload the audio clip using file-transfer
> The URI returned from the audio part of media capture is "bare", i.e. this is 
> the fullPath:
> /accounts/1000/shared/voice/VN-20140704-020436.m4a 
> If I want to play that audio using "new Media" I have to prefix that URI with 
> "file://" otherwise it gives me a cryptic **encoding** error!
> However, if I try to use file-transfer using either the bare URI or the 
> hacked prefixed URI it fails! To make *that* work I have to instead 
> separately prefix the bare URI with cdvfile://localhost/root (not persisent!) 
> and then it works.
> --
> A note, to make matters more complicated, using navigator.camera.capture (not 
> media-capture) for a photo, returns a URI that looks like:
> file:///accounts/1000/shared/camera/IMG_20140704_020404.jpg
> In other words, it's the same as the bare URI + prefix that I mentioned above 
> except... file-transfer works fine with that URL! I don't even.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-7075) BlackBerry10 filesystem URIs are inconsistent and hacky

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-7075?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-7075:
-
Priority: Minor  (was: Major)

> BlackBerry10 filesystem URIs are inconsistent and hacky
> ---
>
> Key: CB-7075
> URL: https://issues.apache.org/jira/browse/CB-7075
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Plugin File Transfer, Plugin Media, Plugin 
> Media Capture
>Affects Versions: 3.5.0
> Environment: Windows 8.1, BlackBerry10
>Reporter: Doug Moscrop
>Priority: Minor
>  Labels: BlackBerry10, Triaged
>
> (sorry for the Component/s spam but it's the pieces involved)
> 1. Record an audio clip using media-capture
> 2. Play the audio clip using the media
> 3. Upload the audio clip using file-transfer
> The URI returned from the audio part of media capture is "bare", i.e. this is 
> the fullPath:
> /accounts/1000/shared/voice/VN-20140704-020436.m4a 
> If I want to play that audio using "new Media" I have to prefix that URI with 
> "file://" otherwise it gives me a cryptic **encoding** error!
> However, if I try to use file-transfer using either the bare URI or the 
> hacked prefixed URI it fails! To make *that* work I have to instead 
> separately prefix the bare URI with cdvfile://localhost/root (not persisent!) 
> and then it works.
> --
> A note, to make matters more complicated, using navigator.camera.capture (not 
> media-capture) for a photo, returns a URI that looks like:
> file:///accounts/1000/shared/camera/IMG_20140704_020404.jpg
> In other words, it's the same as the bare URI + prefix that I mentioned above 
> except... file-transfer works fine with that URL! I don't even.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-6335) Blackberry file plugin accessing file system returns no results

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-6335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-6335:
-
Labels: BlackBerry10 Triaged  (was: BlackBerry10)

> Blackberry file plugin accessing file system returns no results
> ---
>
> Key: CB-6335
> URL: https://issues.apache.org/jira/browse/CB-6335
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 3.4.0
> Environment: File plugin 1.0.1, Blackberry 10.2.x emulator & device 
> (Z10)
>Reporter: Boston Dell-Vandenberg
>Priority: Minor
>  Labels: BlackBerry10, Triaged
>
> Trying to access the Blackberry shared folder and list it's contents but the 
> file plugin is returning no entries (FileError Code 1).
> blackberry.io.sandbox is set to false and the blackberry.io plugin is 
> installed to access the shared folder path.
> I have tested on both emulator and device (10.2) with the following code:
> {code}
> window.requestFileSystem(
>   LocalFileSystem.PERSISTENT,
>   1024 * 1024,
>   function (fs) {
>   fs.root.getDirectory(
> blackberry.io.sharedFolder,
> {},
> function(result) {
>   var reader = result.createReader();
>   reader.readEntries(
> function(entries) {
>   console.log(entries);
> },
> function (error) {
>   console.log('Failed to list directory contents: ', error);
> }
>   );
> },
> function(error) {
>   console.log('Error accessing shared folder');
> }
>   );
>   },
>   function () {
> console.log('Error accessing local file system');
>   }
> );
> {code}



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-6967) File Transfer does not work on BlackBerry with File Plugin version 1.2.0

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-6967?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-6967:
-
Priority: Minor  (was: Major)

> File Transfer does not work on BlackBerry with File Plugin version 1.2.0
> 
>
> Key: CB-6967
> URL: https://issues.apache.org/jira/browse/CB-6967
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Plugin File Transfer
>Affects Versions: 1.2.0
> Environment: Blackberry (Tested on both a Z10 and Q10)
>Reporter: Matt Grande
>Priority: Minor
>  Labels: BlackBerry10, Triaged
>
> Blackberry {{FileTransfer.download}} does not seem to work with {{File}} at 
> version 1.2.0 (Jan 5, 2014).
> *Steps to reproduce*
> # Clone this repository: https://github.com/mattgrande/bb10-download-test.
> # Run {{cordova run blackberry10 --devicepass [your device's password] 
> --keystorepass [the keystorepass]}}.
> # It should download a video, and set the video in the background of your app.
> # Update the {{File}} plugin from 1.1.0 to 1.2.0 by running {{cordova plugin 
> add org.apache.cordova.file}} (Note, you can also upgrade the 
> {{FileTransfer}} plugin, it doesn't seem to make a difference).
> # Execute the {{cordova run}} again.
> # This time, it will fail with error code {{1}}, {{NOT_FOUND_ERR}}.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-6967) File Transfer does not work on BlackBerry with File Plugin version 1.2.0

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-6967?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-6967:
-
Labels: BlackBerry10 Triaged  (was: BlackBerry10)

> File Transfer does not work on BlackBerry with File Plugin version 1.2.0
> 
>
> Key: CB-6967
> URL: https://issues.apache.org/jira/browse/CB-6967
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Plugin File Transfer
>Affects Versions: 1.2.0
> Environment: Blackberry (Tested on both a Z10 and Q10)
>Reporter: Matt Grande
>Priority: Minor
>  Labels: BlackBerry10, Triaged
>
> Blackberry {{FileTransfer.download}} does not seem to work with {{File}} at 
> version 1.2.0 (Jan 5, 2014).
> *Steps to reproduce*
> # Clone this repository: https://github.com/mattgrande/bb10-download-test.
> # Run {{cordova run blackberry10 --devicepass [your device's password] 
> --keystorepass [the keystorepass]}}.
> # It should download a video, and set the video in the background of your app.
> # Update the {{File}} plugin from 1.1.0 to 1.2.0 by running {{cordova plugin 
> add org.apache.cordova.file}} (Note, you can also upgrade the 
> {{FileTransfer}} plugin, it doesn't seem to make a difference).
> # Execute the {{cordova run}} again.
> # This time, it will fail with error code {{1}}, {{NOT_FOUND_ERR}}.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Assigned] (CB-9891) Inconsistent URI encoding causing permission errors on android

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau reassigned CB-9891:


Assignee: Jason Ginchereau

> Inconsistent URI encoding causing permission errors on android
> --
>
> Key: CB-9891
> URL: https://issues.apache.org/jira/browse/CB-9891
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Camera, Plugin File
>Affects Versions: 2.1.0, 3.0.0
> Environment: Android 5+
>Reporter: Connor Pearson
>Assignee: Jason Ginchereau
>  Labels: Android
>
> Using the camera plugin to get a picture from the photo library returns an 
> encoded URI. If you then call resolveLocalFileSystemURI the fileEntry object 
> returned contains the decoded path component of the URI. This path property 
> is used in the toInternalURL function which means it's also decoded. Because 
> Android gave us permission to the encoded URI, but not the decoded URI, 
> attempting to access the decoded URI results in a permission error. 
> {code:javascript}
> document.getElementById("myButton").addEventListener("click", function(){
> navigator.camera.getPicture(function(uri){
> console.log(uri); 
> //content://com.android.providers.media.documents/document/image%3A27 
>   window.resolveLocalFileSystemURI(uri, function(fileEntry){
> console.log(fileEntry.toInternalURL()); 
> //cdvfile://localhost/content/com.android.providers.media.documents/document/image:27
>   
> fileEntry.file(function(){alert("success");}, 
> function(){alert("fail");});
> },function(error){
> // resolved by pulling in PR 119
> alert("Fail resolveFileSystemURI code: " + error.code);
> });
> }, null, {sourceType: 0, allowEdit: false});
> });
> {code}
> I feel like something must be wrong in one of the plugins, but I'm not sure 
> where.
> One possible fix is calling uri.getEncodedPath() instead of uri.getPath in 
> LocalFileSystemURL.parse and then removing the call to encodeURI() from 
> FileSystem.js, but I'm not sure if this is the right strategy.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8497) FileEntry.remove() and FileEntry.file() fail if the file has '#' in its name

2015-11-10 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-8497:
--

Repro'd and fixed on iOS also. I'm submitting a PR.

> FileEntry.remove() and FileEntry.file() fail if the file has '#' in its name
> 
>
> Key: CB-8497
> URL: https://issues.apache.org/jira/browse/CB-8497
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: iOS 8.1.3 and Android 5.0
>Reporter: Dani Palou
>Assignee: Jason Ginchereau
>
> If I try to delete a file that has the character '#' in its name, the 
> 'remove' function always fails, returning FileError.NOT_FOUND_ERR. If the 
> file doesn't have the '#' character, the code works fine. This error is 
> happening both in Android 5 and iOS 8.1.3.
> The same happens for the 'file' function.
> This is one of the FileEntries that I'm testing with:
> {quote}
> fullPath: "/tmp/test#.txt",
> isDirectory: false,
> isFIle: true,
> name: "test#.txt",
> nativeURL: "file:///storage/emulated/0/tmp/test%23.txt"
> {quote}
> I obtained this FileEntry using a DirectoryReader to read the contents of the 
> parent folder.
> I'm testing with PhoneGap CLI 4.2.0, FilePlugin 1.3.3, PhoneGap Android 3.6.4 
> and PhoneGap iOS 3.7.0.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-9416) DirectoryEntry.getParent can't resolve dot dot(..) in path

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-9416:
-
Priority: Minor  (was: Major)

> DirectoryEntry.getParent can't resolve dot dot(..) in path
> --
>
> Key: CB-9416
> URL: https://issues.apache.org/jira/browse/CB-9416
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 5.1.1
>Reporter: FangLijun
>Priority: Minor
>  Labels: Triaged
>
> resolveLocalFileSystemURL('file:///data/..',function(d){data_dot=d});
> data_dot.getParent(function(d){data_dot_p=d})
> data_dot_p.nativeURL
> => "file:///data/"
> should be "file:///"



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-9416) DirectoryEntry.getParent can't resolve dot dot(..) in path

2015-11-10 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-9416:
--

Dot-dots are not evaluated anywhere in the file plugin as far as I can see. 
Changing priority to Minor because this doesn't seem like very important 
functionality.

> DirectoryEntry.getParent can't resolve dot dot(..) in path
> --
>
> Key: CB-9416
> URL: https://issues.apache.org/jira/browse/CB-9416
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 5.1.1
>Reporter: FangLijun
>  Labels: Triaged
>
> resolveLocalFileSystemURL('file:///data/..',function(d){data_dot=d});
> data_dot.getParent(function(d){data_dot_p=d})
> data_dot_p.nativeURL
> => "file:///data/"
> should be "file:///"



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-9416) DirectoryEntry.getParent can't resolve dot dot(..) in path

2015-11-10 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-9416:
-
Labels: Triaged  (was: )

> DirectoryEntry.getParent can't resolve dot dot(..) in path
> --
>
> Key: CB-9416
> URL: https://issues.apache.org/jira/browse/CB-9416
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 5.1.1
>Reporter: FangLijun
>Priority: Minor
>  Labels: Triaged
>
> resolveLocalFileSystemURL('file:///data/..',function(d){data_dot=d});
> data_dot.getParent(function(d){data_dot_p=d})
> data_dot_p.nativeURL
> => "file:///data/"
> should be "file:///"



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8497) FileEntry.remove() and FileEntry.file() fail if the file has '#' in its name

2015-11-09 Thread Jason Ginchereau (JIRA)

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

Jason Ginchereau commented on CB-8497:
--

I've reproduced this on Android, and I have a fix there, in the Android 
platform-specific code for the file plugin.

I confirmed the issue does NOT repro on Windows.

I will check iOS next.

> FileEntry.remove() and FileEntry.file() fail if the file has '#' in its name
> 
>
> Key: CB-8497
> URL: https://issues.apache.org/jira/browse/CB-8497
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: iOS 8.1.3 and Android 5.0
>Reporter: Dani Palou
>Assignee: Jason Ginchereau
>
> If I try to delete a file that has the character '#' in its name, the 
> 'remove' function always fails, returning FileError.NOT_FOUND_ERR. If the 
> file doesn't have the '#' character, the code works fine. This error is 
> happening both in Android 5 and iOS 8.1.3.
> The same happens for the 'file' function.
> This is one of the FileEntries that I'm testing with:
> {quote}
> fullPath: "/tmp/test#.txt",
> isDirectory: false,
> isFIle: true,
> name: "test#.txt",
> nativeURL: "file:///storage/emulated/0/tmp/test%23.txt"
> {quote}
> I obtained this FileEntry using a DirectoryReader to read the contents of the 
> parent folder.
> I'm testing with PhoneGap CLI 4.2.0, FilePlugin 1.3.3, PhoneGap Android 3.6.4 
> and PhoneGap iOS 3.7.0.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-9921) applicationDirectory wrong on browser platform

2015-11-05 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-9921:
-
Labels: Browser  (was: browser)

> applicationDirectory wrong on browser platform
> --
>
> Key: CB-9921
> URL: https://issues.apache.org/jira/browse/CB-9921
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: Master
>Reporter: Kevin Christopher Henry
>Priority: Minor
>  Labels: Browser
>
> In the code for the browser platform, {{applicationDirectory}} is defined as 
> {{location.origin + "/"}}, which with file URLs resolves to simply 
> {{file:///}}.
> Clearly, the root of the filesystem is not generally going to be the 
> application's directory.
> It could be tricky to figure out the right value to use here. But it would be 
> better to indicate a lack of support ({{null}}?) than to return an obviously 
> wrong value.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-6901) [WP8][cordova-plugin-file] filesystem: null after use IsolatedStorageFile.MoveDirectory

2015-11-05 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-6901?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-6901:
-
Labels: WP8 Windows  (was: windows wp8)

> [WP8][cordova-plugin-file] filesystem: null after use 
> IsolatedStorageFile.MoveDirectory
> ---
>
> Key: CB-6901
> URL: https://issues.apache.org/jira/browse/CB-6901
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
>Affects Versions: 3.5.0
> Environment: Windows 8.1
>Reporter: Martin Gonzalez
>Assignee: Jesse MacFadyen
>  Labels: WP8, Windows
> Fix For: 3.6.0
>
>
> Using the File plugin, faced a problem trying to move a directory using the 
> plugin, specifically the moveTo (aka TransferTo on native) , I've found out 
> that the problem is not that the directory is not moved, the problem is that 
> after this line is executed:
> https://github.com/apache/cordova-plugin-file/blob/master/src/wp/File.cs#L1412
> isoFile.MoveDirectory(currentPath, newPath);
> The DispatchCommandResult sends the entry file with the CallbackID, but the 
> problem is that the information about the filesystem is missing.
> This situation it doesn't happen when isoFile.MoveFile(newPath), 
> IsolatedStorageFile.CreateDirectory(path) or 
> IsolatedStorageFile.CreateFile(path) are used the filesystem information it 
> remains with those but not with MoveDirectory.
> During the 67 test and several others, it uses the filesystem information of 
> the recent moved directory to determine if the file exists, and when it gets 
> to GeFileOrDirectory on the options this is the array obtained:
> "[null,"file1","{\"create\":false}","File619232322"]"
> When Create or MoveFile:
> "["\/\/entry,move.dsp.srcDir","file1","{\"create\":false}","File619232322"]"
> From the JS side object:
> MoveDirectory:
> {"isFile":false, "isDirectory":true, "name" : "entry.move.dsp.dstDir", 
> "filesystem":null, "nativeURL":null}
> MoveFile:
> {"isFile":true, "isDirectory":false, "name" : "entry.move.dsp.dstDir", 
> "filesystem":"", "nativeURL":null}
> That's the reason why some automated tests on the MoveTo section are failing.
> Tested on Windows Phone 8 and 8.1, emulator and device. Same behavior.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-9934) Have "Missing Command Error" when requesting a file system

2015-11-05 Thread Jason Ginchereau (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-9934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Ginchereau updated CB-9934:
-
Labels: Browser  (was: browser)

> Have "Missing Command Error" when requesting a file system
> --
>
> Key: CB-9934
> URL: https://issues.apache.org/jira/browse/CB-9934
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File
> Environment: cordova -v 5.3.3
> cordova-plugin-file "version": "3.0.0"
> Google Chrome Version 46.0.2490.80
>Reporter: Mikalai Birukou
>Assignee: Tim Barham
>  Labels: Browser
>
> Observation #1:
> Listener of 'filePluginIsReady' on window is never triggered.
> Observation #2 (related?):
> cordova.js line 925:
> fail && fail("Missing Command Error");
> is touched both at the start of at app's initialization, followed by "adding 
> proxy for File" from line 943 occures with consequent "Persistent fs quota 
> granted" from Preparing.js, and no error shows in the console.
> When requestFileSystem() is called afterwards, manually or in code, much 
> later, line 925 is touched, and error 'FileError {code: "Missing Command 
> Error"}' shows in the console.



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

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



  1   2   >