Skip to content

feat(file): add SHA pre-check, force upload, and 409#38

Merged
retr0h merged 1 commit intomainfrom
feat/file-upload-precheck-force
Mar 7, 2026
Merged

feat(file): add SHA pre-check, force upload, and 409#38
retr0h merged 1 commit intomainfrom
feat/file-upload-precheck-force

Conversation

@retr0h
Copy link
Collaborator

@retr0h retr0h commented Mar 7, 2026

Summary

  • Add SDK-side SHA-256 pre-check to skip uploads when file content is unchanged, avoiding unnecessary network transfer
  • Add WithForce upload option to bypass both client-side pre-check and server-side digest check
  • Add 409 Conflict error handling for duplicate file uploads

Test plan

  • Verify just test passes (unit tests, lint, vet)
  • Verify pre-check skips upload when SHA matches existing file
  • Verify WithForce bypasses pre-check and forces upload
  • Verify 409 Conflict response is properly surfaced as error

🤖 Generated with Claude Code

@github-actions
Copy link

github-actions bot commented Mar 7, 2026

Thank you for contributing to this project! 😊🕹️

Add SDK-side SHA-256 pre-check to skip uploads when content
is unchanged. Add WithForce option to bypass pre-check and
server-side digest check. Add 409 Conflict error handling.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@retr0h retr0h force-pushed the feat/file-upload-precheck-force branch from b2fc8ba to bb87fef Compare March 7, 2026 05:54
@codecov
Copy link

codecov bot commented Mar 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #38   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         1655      1714   +59     
=========================================
+ Hits          1655      1714   +59     
Files with missing lines Coverage Δ
pkg/osapi/file.go 100.00% <100.00%> (ø)
pkg/osapi/file_types.go 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4a9206...bb87fef. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@retr0h retr0h merged commit ba9d92f into main Mar 7, 2026
7 checks passed
@retr0h retr0h deleted the feat/file-upload-precheck-force branch March 7, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant