fix: make one-time downloads atomic (ai:gpt-5) #56

Manually merged
heiko merged 2 commits from fix/49-non-atomic into master 2026-05-23 23:50:54 +02:00
Owner

Summary

  • add an atomic store-level claim operation for one-time downloads
  • switch the download handler to claim content before streaming
  • add regression tests for downloaded metadata and concurrent claim attempts

Verification

  • GOWORK=off GOMODCACHE=/tmp/once-go-mod GOCACHE=/tmp/once-go-build CCACHE_DIR=/tmp/once-ccache go test ./...
  • GOWORK=off GOMODCACHE=/tmp/once-go-mod GOCACHE=/tmp/once-go-build CCACHE_DIR=/tmp/once-ccache go test -race ./cmd/once-server/store
  • git diff --check
  • Gemini review requested; no blocking issue found, optional handler-level concurrency test suggested.

Addresses #49.

## Summary - add an atomic store-level claim operation for one-time downloads - switch the download handler to claim content before streaming - add regression tests for downloaded metadata and concurrent claim attempts ## Verification - `GOWORK=off GOMODCACHE=/tmp/once-go-mod GOCACHE=/tmp/once-go-build CCACHE_DIR=/tmp/once-ccache go test ./...` - `GOWORK=off GOMODCACHE=/tmp/once-go-mod GOCACHE=/tmp/once-go-build CCACHE_DIR=/tmp/once-ccache go test -race ./cmd/once-server/store` - `git diff --check` - Gemini review requested; no blocking issue found, optional handler-level concurrency test suggested. Addresses #49.
- Differentiate 404 (content gone/already claimed) from 500 (open failed
  after rename) in the Claim error path.
- Replace deprecated io/ioutil.TempFile with os.CreateTemp in updateMeta.
heiko manually merged commit aa6a62884c into master 2026-05-23 23:50:54 +02:00
Sign in to join this conversation.
No description provided.