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
Fix Storage Emulator crash on iOS auth error for resumable uploads #4210
Conversation
1526d08
to
32c7764
Compare
Capturing some of what we synced on offline: There seems to be a bigger bug in our handling of finalize upload requests. Namely, we call My take is that we probably want to refactor the finalize upload handler in |
fb8ab15
to
9a71421
Compare
9a71421
to
6fd4c62
Compare
6fd4c62
to
f21dd97
Compare
505338b
to
9d446e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall lgtm, just a few small remaining comments
}) | ||
.expect(200); | ||
|
||
await supertest(STORAGE_EMULATOR_HOST) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add an assertion in this test case or another that ensures the querying for the upload after a cancel denotes that the upload was cancelled?
go/unified-upload-protocols#ended-uploads
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we're doing this now actually 😅 But I would fix this in another PR.
9d446e6
to
407a762
Compare
407a762
to
072516f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix
Description
Issue(s)
Follow up to #4184. This PR fixes #3550, #3584, #3765, and #3890.
Previously, we fixed the issue where the iOS client receives a permissions error despite being authenticated to make a write. However, we still need to address the issue where the Storage Emulator crashes on any such permissions error.
Cause
When the upload request is finalised, the file is moved. When the iOS client subsequently receives a 403, it cancels the request. During the cancel, the emulator attempts to delete the file at its old temporary location, resulting in the following error:
Scenarios Tested
Tested against example linked in issue and verified that crash does not occur after fix. Also tested with storage rules that always give an auth error, i.e.
allow read, write: if false
.