-
Notifications
You must be signed in to change notification settings - Fork 173
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
[Bug]: BlobClient.PutBlockList() unusable #615
Comments
It produces different type of blob. It would help if we could convert easily afterwards. But once the blob has been created, its type cannot be changed, and it can be updated only by using operations appropriate for that blob type, so it is not easiy convertable, only downloading and uploading with different type, which is negating all efforts we are trying to use here. Thank you for opening this ticket, I was looking for solution and you managed to get there first :) |
for reference, my Yammer post |
That sounds like a great candidate for a code contribution! Issue approved. Please go ahead and create a PR 😊 |
<!-- Thank you for submitting a Pull Request. If you're new to contributing to BCApps please read our pull request guideline below * https://github.com/microsoft/BCApps/Contributing.md --> #### Summary <!-- Provide a general summary of your changes --> Added PutBlockList overload method with required BlobName param to BlobClient interface Added PutBlock methods with required BlobName param to BlobClient interface BlobClient implementation updated to set required BlobName param New unit test for PutBlock and PutBlockList methods. #### Work Item(s) <!-- Add the issue number here after the #. The issue needs to be open and approved. Submitting PRs with no linked issues or unapproved issues is highly discouraged. --> Fixes #615 Fixes [AB#502953](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/502953)
Describe the issue
While working with Azure Blob Services API module I found some inconsistencies and after analyzing it I want to share it.
The point is that PutBlockList cannot be used now.
BCApps/src/System Application/App/Azure Blob Services API/src/ABSBlobClient.Codeunit.al
Line 772 in cd59daa
According to the documentation:
But at the same time PutBlock operation is not represented in the ABSBlobClient codeunit. Which makes it impossible to use the PutBlockList() method.
What is interesting is that in the implementation this method already exists and all we have to do is add it to the ABSBlobClient interface.
BCApps/src/System Application/App/Azure Blob Services API/src/ABSClientImpl.Codeunit.al
Line 652 in cd59daa
In addition, I think that the PutBlockList() method lacks the BlobName parameter because it is not clear at what point this name is implicitly received by ABSOperationPayload.
BCApps/src/System Application/App/Azure Blob Services API/src/ABSClientImpl.Codeunit.al
Line 676 in cd59daa
Expected behavior
This should work so that we can make multiple PutBlocks with a unique identifier in Base64 and then modify/add the blocks we need to get one initial Blob consisting of these blocks.
As example:
Put first uncommitted block:
Put second uncommitted block:
Commit two blocks as one Blob:
Steps to reproduce
Try to use PutBlockList
Additional context
I originally wanted to send a PR with a fix, but judging by the rules it has to be negotiated in Issue first. And yes I know AppendBlock works in a similar way and it works fine.
I will provide a fix for a bug
The text was updated successfully, but these errors were encountered: