Skip to content

fix(services/seafile): avoid defaulting list size to zero#7221

Merged
Xuanwo merged 1 commit intomainfrom
xuanwo/seafile-list-content-length
Feb 24, 2026
Merged

fix(services/seafile): avoid defaulting list size to zero#7221
Xuanwo merged 1 commit intomainfrom
xuanwo/seafile-list-content-length

Conversation

@Xuanwo
Copy link
Member

@Xuanwo Xuanwo commented Feb 23, 2026

Which issue does this PR close?

Part of #7062.

Rationale for this change

seafile lister currently maps missing size in list response to 0.
This mixes "size is unknown in list response" with "real zero-byte file", which is semantically incorrect.

What changes are included in this PR?

  • Update core/services/seafile/src/lister.rs:
    • Remove unwrap_or(0) when setting file content_length.
    • Set content_length only when info.size exists.

This preserves correct zero-byte semantics while allowing core completion logic to fill missing sizes when needed.

Validation:

  • cargo fmt
  • cargo check --features services-seafile,tests
  • cargo test -p opendal-service-seafile

Are there any user-facing changes?

Yes.

For seafile, list entries no longer report content_length = 0 when list response omits size.

AI Usage Statement

This PR was developed with Codex (GPT-5) assistance.

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. releases-note/fix The PR fixes a bug or has a title that begins with "fix" labels Feb 23, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 23, 2026
@Xuanwo Xuanwo merged commit b51c577 into main Feb 24, 2026
94 checks passed
@Xuanwo Xuanwo deleted the xuanwo/seafile-list-content-length branch February 24, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants