Large file uploads do not send src_last_modified_millis like small uploads do

Open Beginner friendly
#248 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
cloud

Research direction

Start in core/src/main/java/com/backblaze/b2/client/structures/B2StartLargeFileRequest.java, in buildFrom (around lines 125-157), and compare it with the small-file path in core/src/main/java/com/backblaze/b2/client/B2StorageClientWebifierImpl.java (around lines 306-315). Check whether the content source's last-modified millis is copied into the builder for large files. Done when a large upload from a B2FileContentSource carries src_last_modified_millis in its file info, matching the small-file behaviour, with a test covering it.

Written by the indexing model from the issue text.

Description

What happens

For a small file, the SDK sends the content source's last-modified time as X-Bz-Info-src_last_modified_millis, and the README says the SDK adds this field on uploads. For a large file, B2StartLargeFileRequest.buildFrom copies the file info, sha1 and other settings but never reads the source's last-modified time, so the field is missing on large files uploaded through uploadLargeFile.

Where

core/src/main/java/com/backblaze/b2/client/structures/B2StartLargeFileRequest.java:125-157 (buildFrom); compare core/src/main/java/com/backblaze/b2/client/B2StorageClientWebifierImpl.java:306-315 (small file path) and README.md:36.

Why it matters

Impact: Wrong request or result (metadata silently missing), silent. Severity: High, because it happens on the normal path for every large upload whose content source provides a last-modified time, and the only workaround is setting src_last_modified_millis by hand through setCustomFields.

How to check

Found by reading the code, not reproduced. Upload a large file from a B2FileContentSource and read its file info: by reading, src_last_modified_millis is only set by the small-file path. In buildFrom, calling orig.getContentSource().getSrcLastModifiedMillisOrNull() and builder.setSrcLastModifiedMillisOrNull(...) when non-null would match the small-file behaviour.

Version

Seen at v6.5.0. Present on the default branch: present.

Dominant language
Java
Stars
103
Forks
23
Avg merge
5d 8h
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Backblaze/b2-sdk-java

All issues in Backblaze/b2-sdk-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.