Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
-
Marshmallow
Description
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. For example,
getFile('test1', {create:true}, function(){}, function(){}); getDirectory('test2', {create:true}, function(){}, function(){});
In the above code block, only the second call (getDirectory) would get a success or error callback. Furthermore, this code will attempt to create both a directory and a file named test1 because the permission callback for the first call will be executed using the arguments from the second call.