[
https://issues.apache.org/jira/browse/CB-10977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15214823#comment-15214823
]
Richard B Knoll commented on CB-10977:
--------------------------------------
To reproduce:
{code:javascript}
window.resolveLocalFileSystemURL(cordova.file.externalRootDirectory,
function(dirEntry) {
// Create a directory before runtime write permission has been granted
dirEntry.getDirectory('test1', {create: true}, function(createdDir) {
createdDir.remove(function(){
alert('Removed test1')
}, function(){});
}, function(){});
// Create a second directory before the first permission request is
allowed/denied
dirEntry.getDirectory('test2', {create: true}, function(createdDir) {
createdDir.remove(function(){
alert('Removed test2')
}, function(){});
}, function(){});
}, function(){});
{code}
The user will be asked to grant permission twice but the app will only display
'Removed test2'. The Android logs will show that a second result is sent to the
callback context
> Overlapping permission requests in Android can cause errors
> -----------------------------------------------------------
>
> Key: CB-10977
> URL: https://issues.apache.org/jira/browse/CB-10977
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin File
> Environment: Marshmallow
> Reporter: Richard B Knoll
> Assignee: Richard B Knoll
> Priority: Critical
> Labels: android, reproduced, triaged
>
> We use global state for permission requests in the file plugin that gets
> overwritten on each call to the plugin. That means that if multiple
> writes/reads are performed while the permission request is pending, the
> global state will get overwritten and callbacks will not be returned correctly
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]