adobe / aio-lib-files

An abstraction on top of cloud blob storage exposing a file system like API
https://www.adobe.io
Apache License 2.0
10 stars 14 forks source link

files.list and files.delete are limited to 5000 files #73

Open amol-anand opened 3 years ago

amol-anand commented 3 years ago

Expected Behaviour

await files.delete('/') should delete all files

Actual Behaviour

files.delete('/') only deletes 5000 files

Reproduce Scenario (including but not limited to)

Run await files.delete('/') on an account that has more than 5000 files. Run files.list('/') before and after the delete command to see how many files were deleted.

Steps to Reproduce

Platform and Version

aio-lib-files version 1.3.1

Sample Code that illustrates the problem

  //Initialize aio-lib-files  
  const files = await filesLib.init();
  LOG.debug('aio-lib-files initialized');
  const allFiles = await files.list('/');
  LOG.debug('Listing all files. Number of files are: '+allFiles.length);
  const deletedFiles = await files.delete('/');
  LOG.debug('Number of deleted files: '+deletedFiles.length);

Logs taken while reproducing problem

No useful logging. "response": { "result": { "error": "The action did not produce a valid response and exited unexpectedly." }, "status": "action developer error", "success": false }

meryllblanchet commented 3 years ago

Thanks for raising the issue, @amol-anand ! This looks like a default limit of the underlying storage, but ideally the SDK should handle the operation in the most appropriate manner.

cc @purplecabbage @sandeep-paliwal @moritzraho for feedback

aiojbot commented 3 years ago

JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-946

moritzraho commented 3 years ago

After some investigation I can conclude that there are two issues here: