Fix missing upload status header in resumable upload finalise response #4407
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.
Description
Issue
This PR fixes #4346, #4364, and #4396.
Any large (> ~500kB) upload to the Storage Emulator gives a console error.
On web:
On iOS:
On the emulator UI, the upload is shown with a loading spinner indefinitely. However, on refresh we see that the file was in fact uploaded successfully.
This issue started in v10.3.0.
Cause
In #4250 we refactored the upload logic. In doing so we forgot to include the header
X-Goog-Upload-Status
with valuefinal
in the response for thefinalize
request. My guess is that the client expects to make furtherupload
requests and errors out when there are no more bytes to upload.Scenarios Tested
Tested on web and verified that console error no longer appears and that the header is included in the response. Also included a check for the latter in an existing integration test for resumable uploads.