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

uploadStream uploads 0 size object when you pass an empty object to bufferSize #31760

Open
1 of 2 tasks
tonybart1337 opened this issue Nov 14, 2024 · 1 comment
Open
1 of 2 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

@tonybart1337
Copy link

  • Package Name: @azure/blob-storage
  • Package Version: any version up to 12.25.0
  • Operating system:
  • nodejs
    • version: any supported
  • typescript
    • version: I'm using javascript

Describe the bug
If you pass an empty object to bufferSize parameter of uploadStream then it will upload and overwrite the object with 0 bytes, completely ignoring the input stream without any indication that something went wrong

To Reproduce
Steps to reproduce the behavior:

    const blobServiceClient = new BlobServiceClient(
      'https://REDACTED.blob.core.windows.net'
    );

    const containerClient = blobServiceClient.getContainerClient('REDACTED_CONTAINER_NAME');
    const blockBlobClient = containerClient.getBlockBlobClient('REDACTED_FILE_NAME');

    // when you pass an empty object    
    const opts = {};
    const result = await blockBlobClient.uploadStream(dataStream, opts);

Expected behavior
Throw an error that bufferSize has invalid type or any other indication that it didn't upload the entire stream

@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 Nov 14, 2024
Copy link

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

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

2 participants