Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onProgress() callback for BlockBlobClient.uploadData() in the browser isn't granular #32404

Open
1 of 6 tasks
au5ton opened this issue Jan 2, 2025 · 2 comments
Open
1 of 6 tasks
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@au5ton
Copy link

au5ton commented Jan 2, 2025

  • Package Name: @azure/storage-blob
  • Package Version: 12.26.0
  • Operating system: Windows 23H2
  • nodejs
    • version:
  • browser
    • name/version: Edge/131.0.2903.112
  • typescript
    • version:
  • Is the bug related to documentation in

Describe the bug

The onProgress() callback when using BlockBlobClient.uploadData() in the browser is not granular and only updates after each block. This makes it impractical for progress bars and progress reporting without making chunks very small and inefficient. 

To Reproduce
Steps to reproduce the behavior:

  1. Acquire a sufficiently large test file: https://ash-speed.hetzner.com/1GB.bin
  2. Acquire a SAS URL for a browser to upload a blob directly to Azure Blob Storage
  3. Upload the blob in blocks:
const SAS_URL = '(...)';
const input = document.querySelector(`input[type=file]`);
const { BlockBlobClient, AnonymousCredential } = await import('@azure/storage-blob');
const blobClient = new BlockBlobClient(SAS_URL, new AnonymousCredential());
const res= await blobClient.uploadData(input.files.item(0), {
  maxSingleShotSize: 30_000_000, // ~30 megabytes
  blockSize: 30_000_000,
  concurrency: 1,
  onProgress(progress) {
    // only reports in chunks of 30_000_000 bytes, no intermediate progress
    console.log('Progress:', progress);
  }
});
  1. The onProgress callback does not report the progress granularly in a useful way.

Expected behavior
Expected that upload progress be recorded more interactively and at a sub-block refresh rate.

Screenshots
N/A

Additional context

From what I've researched, I am aware of a couple of different factors that contribute to this being the case:

I (naively) think this could be mostly resolved with a few steps:

  1. Export createXhrHttpClient() in @azure/core-rest-pipeline to allow browser consumers to import it again. Maybe there's a history with this being deprecated/removed?
  2. Implement block-level tracking in BlockBlobClient.uploadSeekableInternal() and as a result in BlockBlobClient.uploadData() (see snippets to stub code above)

What is the team's stance on this? Thanks.

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files) labels Jan 2, 2025
Copy link

github-actions bot commented Jan 2, 2025

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

@jeremymeng
Copy link
Member

related: #32247

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

3 participants