Fixed Unexpected EOF
error when batch InsertReplace table entities with Go SDK (issue #2519)
#2521
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix issue : #2519
currently latest Go SDK will fail with "Unexpected EOF" when run table batch TransactionTypeInsertReplace or TransactionTypeAdd. (TransactionTypeInsertMerge won't fail)
The root cause is : There are 3 "\r\n" after etag in responds from product Azure, but only 2 "\r\n" in the responds from Azurite.
Responds from product Azure:
Responds from Azurite:
From https://github.com/Azure/Azurite/blob/main/src/table/batch/TableBatchSerialization.ts we can see:
Following 2 functions has 1 addtional "\r\n" after Etag, so they works with Go SDK.
Following 2 functions doesn't have additional "\r\n" after Etag, so they doesn't work.
After add additional "\r\n" after Etag in serializeTableInsertEntityBatchResponse() and serializeTableUpdateEntityBatchResponse(), the issue if fixed with Go SDK in my manual test.
This PR fix this issue, and manually validated it works.
As the issue only repro with Go SDK, it's not easy to add test case to cover this scenario.
===========================================
Thanks for contribution! Please go through following checklist before sending PR.
PR Branch Destination
main
branch.legacy-dev
branch.Always Add Test Cases
Make sure test cases are added to cover the code change.
Add Change Log
Add change log for the code change in
Upcoming Release
section inChangeLog.md
.Development Guideline
Please go to CONTRIBUTION.md for steps about setting up development environment and recommended Visual Studio Code extensions.