Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10977

Overlapping permission requests in Android can cause errors

    XMLWordPrintableJSON

Details

    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.

      Attachments

        Activity

          People

            riknoll Richard B Knoll
            riknoll Richard B Knoll
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: