Repository navigation
fix(services): return authoritative copy metadata - #8197
Merged
Merged
Conversation
# Conflicts: # core/core/src/docs/specs/metadata.md # core/core/src/layers/complete.rs # core/core/src/layers/correctness_check.rs # core/core/src/raw/ops.rs # core/layers/mime-guess/src/lib.rs # core/services/aliyun-drive/src/backend.rs # core/services/dropbox/src/backend.rs # core/services/koofr/src/backend.rs # core/services/lakefs/src/backend.rs # core/services/obs/src/backend.rs # core/services/onedrive/src/backend.rs # core/services/pcloud/src/backend.rs # core/services/s3/src/copier.rs # core/services/upyun/src/backend.rs # core/services/vercel-blob/src/backend.rs # core/services/webdav/src/backend.rs # core/services/webdav/src/core.rs # core/services/yandex-disk/src/backend.rs
Xuanwo
marked this pull request as ready for review
August 31, 2026 05:17
PsiACE
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
N/A. Follow-up to #8196.
Rationale for this change
copymust return file metadata with an authoritative content length. Several server-side copy APIs do not report the copied size, while callers may already know it. Reading source metadata despite an explicitsource_content_length_hintdefeats the hint's purpose and adds an avoidable request.What changes are included in this PR?
Copy implementations now use an authoritative size reported by the service when available. Otherwise, they trust
source_content_length_hintwithout an additional source metadata request and read source metadata only when no hint is provided. S3 reuses the no-hint source snapshot to pin the copied version or ETag. The public option and metadata contract document these semantics.Are there any user-facing changes?
Yes. Successful copy operations return file metadata with content length. Providing
source_content_length_hintavoids metadata reads performed solely to determine size; an incorrect hint may produce incorrect result metadata or copy planning.AI Usage Statement
AI materially assisted with the implementation, copy-service audit, merge-conflict resolution, and local validation. The change was not verified against credential-backed instances of every affected service; review relies on protocol-level code paths, focused tests, and workspace validation. The author reviewed and directed the behavior, including that a supplied source length hint must not trigger a metadata request solely to obtain source identity or size.