Skip to content

fix(services): return authoritative copy metadata - #8197

Merged
Xuanwo merged 9 commits into
mainfrom
xuanwo/compact-metadata
Aug 31, 2026
Merged

Xuanwo merged 9 commits into
mainfrom
xuanwo/compact-metadata

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Aug 31, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

N/A. Follow-up to #8196.

Rationale for this change

copy must 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 explicit source_content_length_hint defeats 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_hint without 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_hint avoids 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.

Xuanwo added 9 commits August 29, 2026 22:45
# 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
Xuanwo marked this pull request as ready for review August 31, 2026 05:17
@Xuanwo
Xuanwo merged commit cf2a26e into main Aug 31, 2026
453 of 455 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/compact-metadata branch August 31, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants