Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
MIT License
1.83k stars 325 forks source link

The behavior of listing blobs is inconsistent between Azurite and Azure #605

Open wwlorey opened 4 years ago

wwlorey commented 4 years ago

Which service(blob, file, queue, table) does this issue concern?

Blob

Which version of the Azurite was used?

v3.9.0

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

VS Code extension

What's the Node.js version?

v10.16.3

What problem was encountered?

In Azurite, listBlobsByHierarchy attempts to list a directory and its contents when the directory is loaded. Azure lists only the top level directory until that directory's contents are explicitly loaded.

Steps to reproduce the issue?

  1. Create an emulated blob container using Azurite and a real blob container in Azure.
  2. Upload a directory containing 100 files to each container.
    dir/file1
    dir/file2
    ...
    dir/file100
  3. Call listBlobsByHierarchy for each container with a max page size of 50.
    let response = containerClient.listBlobsByHierarchy(path.posix.sep, { prefix }).byPage({ continuationToken, maxPageSize: 50 })
    let responseValue = (await response.next()).value;
  4. In both cases a single blob directory is returned in responseValue.segment.blobPrefixes. But the continuation token for Azurite does not match Azure.
Azurite Azure
Screen Shot 2020-10-30 at 4 09 12 PMScreen Shot 2020-10-30 at 4 09 23 PM Screen Shot 2020-10-30 at 4 08 22 PMScreen Shot 2020-10-30 at 4 08 34 PM

And (await response.next()).done is false in both cases.

Have you found a mitigation/solution?

N/A

XiaoningLiu commented 4 years ago

Thanks for bring this up! Will take an investigation.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.