fix(dav): abort chunked v2 writes when deleting upload folder - #64110
fix(dav): abort chunked v2 writes when deleting upload folder#64110joshtrichards wants to merge 2 commits into
Conversation
Resolve DELETE requests against the upload folder itself and use the stored upload metadata rather than requiring a `Destination` header. The header was not required by the original implementation but became required due to an inadvertent regression in #38100. Allow uploads without v2 metadata to proceed through normal DAV deletion. Reject inconsistent v2 metadata, propagate backend cancellation failures, and remove the cached session after successful cancellation. Assisted-by: Copilot:gpt-5.6-sol Signed-off-by: Josh <josh.t.richards@gmail.com>
Add unit coverage for deleting chunked v2 upload folders, including: - cancellation without a Destination header; - resolution of existing and temporary upload targets; - cache cleanup after successful cancellation; - missing and incomplete upload metadata; - unsupported storage backends; - multipart capability failures; and - propagation of cancellation and target-resolution errors. Assisted-by: Copilot:gpt-5.6-sol Signed-off-by: Josh <josh.t.richards@gmail.com>
|
Nice catch on the My worry is that the new error paths can leave the upload folder impossible to delete at all. Could the abort be best effort? Catch those, log, and let normal DAV deletion continue. Failing to cancel is bad but it's what happens today anyway, whereas a folder the client can't remove is new. Separately, maybe out of scope: |
Summary
Restore cancellation of Chunking v2 backend writes when an upload folder is deleted.
The original Chunking v2 implementation in #27034 resolved DELETE requests against the upload folder itself and did not require a
Destinationheader. This behavior inadvertently regressed in #38100, which began resolving the parent directory and applying prerequisites intended for PUT and MOVE requests, including theDestinationheader requirement,As a result, deleting an upload folder did not call
cancelChunkedWrite(). For object-storage-backed uploads, this could leave the underlying multipart upload active even though the DAV upload folder was deleted.This fix allows uploads without v2 metadata to proceed through normal DAV deletion, rejects inconsistent v2 metadata, propagates backend cancellation failures, and removes the cached session after successful cancellation.
Specifically, this change:
Destinationheader for DELETE;This restores the intended behavior of the documented abort operation:
No client changes required.
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)