veza/veza-backend-api/internal/core/track
senke 8699004974 feat(track): native S3 multipart for chunked uploads (v1.0.9 item 1.5)
Replaces the historical chunked-upload flow when TRACK_STORAGE_BACKEND=s3:

  before: chunks → assembled file on disk → MigrateLocalToS3IfConfigured
          opens the file → manager.Uploader streams in 10 MB parts
  after:  chunks → io.Pipe → manager.Uploader streams in 10 MB parts
          (no assembled file on local disk)

Eliminates the second local copy of every upload and ~500 MB of disk
I/O per concurrent 500 MB upload. The local-storage path
(TRACK_STORAGE_BACKEND=local, default) is unchanged — it still goes
through CompleteChunkedUpload + CreateTrackFromPath because ClamAV needs
the assembled file (chunked path skips ClamAV by design, see audit).

New surface:
  - TrackChunkService.StreamChunkedUpload(ctx, uploadID, dst io.Writer)
    — extracted from CompleteChunkedUpload, writes chunks in order to
    any io.Writer, computes SHA-256 + verifies expected size, cleans
    up Redis state on success and preserves it on failure (resumable).
  - TrackService.CreateTrackFromChunkedUploadToS3 — orchestrates
    io.Pipe + goroutine, deletes orphan S3 objects on assembly failure,
    creates the Track row with storage_backend=s3 + storage_key.

Tests: 4 chunk-service stream tests (happy / writer error / size
mismatch / delegation) + 4 service tests (happy / wrong backend /
stream error / S3 upload error). One E2E @critical-s3 spec gated on
S3 availability via /health/deep so it ships today and starts running
once MinIO is added to the e2e workflow services block.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 23:12:56 +02:00
..
handler.go feat(v0.10.3): Commentaires & Interactions Sociales - F201-F215 2026-03-09 10:30:47 +01:00
handler_additional_test.go fix(backend,web): restore audio playback via /stream fallback 2026-04-16 14:52:26 +02:00
handler_error_format_test.go refonte: backend-api go first; phase 1 2025-12-12 21:34:34 -05:00
handler_mustget_test.go refonte: backend-api go first; phase 1 2025-12-12 21:34:34 -05:00
handler_ownership_test.go refonte: backend-api go first; phase 1 2025-12-12 21:34:34 -05:00
handler_test.go fix(backend): remediation plan — tests, playback_analytics, job queue, gamification 2026-02-17 16:01:45 +01:00
service.go feat(track): native S3 multipart for chunked uploads (v1.0.9 item 1.5) 2026-04-26 23:12:56 +02:00
service_async_test.go feat(tracks): serve S3-backed tracks via signed URL redirect (v1.0.8 P2) 2026-04-23 23:26:14 +02:00
service_chunked_s3_test.go feat(track): native S3 multipart for chunked uploads (v1.0.9 item 1.5) 2026-04-26 23:12:56 +02:00
service_n1_test.go stabilizing veza-backend-api: phase 1 2025-12-16 11:23:49 -05:00
service_test.go [T0-006] test(backend): Ajout tests pour frontend_log_handler 2026-01-04 01:44:22 +01:00
track_analytics_handler.go feat(openapi): annotate track subsystem (social/analytics/search/hls/waveform) — v1.0.8 B-annot 2026-04-24 00:58:08 +02:00
track_batch_service.go v0.9.4 2026-03-05 23:03:43 +01:00
track_crud_handler.go feat(openapi): annotate track CRUD handlers + regen spec (v1.0.8 B-annot) 2026-04-24 00:45:10 +02:00
track_handler_integration_test.go [BE-API-002] api: Implement playlist collaborators endpoints 2025-12-23 01:41:43 +01:00
track_hls_handler.go feat(openapi): annotate track subsystem (social/analytics/search/hls/waveform) — v1.0.8 B-annot 2026-04-24 00:58:08 +02:00
track_search_handler.go feat(openapi): annotate track subsystem (social/analytics/search/hls/waveform) — v1.0.8 B-annot 2026-04-24 00:58:08 +02:00
track_social_handler.go feat(openapi): annotate track subsystem (social/analytics/search/hls/waveform) — v1.0.8 B-annot 2026-04-24 00:58:08 +02:00
track_upload_handler.go feat(track): native S3 multipart for chunked uploads (v1.0.9 item 1.5) 2026-04-26 23:12:56 +02:00
track_upload_integration_test.go incus deployement fully implemented, Makefile updated and make fmt ran 2026-01-13 19:47:57 +01:00
track_waveform_handler.go feat(openapi): annotate track subsystem (social/analytics/search/hls/waveform) — v1.0.8 B-annot 2026-04-24 00:58:08 +02:00