Skip to content

[P2] TUS auto-resume on partial upload failure #17

@Railly

Description

@Railly

Context

PR #6 ships TUS.IO 1.0.0 client. The spec supports HEAD-then-resume on partial uploads (`tusHead()` is implemented), but `tusUpload()` itself doesn't auto-retry from last offset on network errors. Today: large upload fails mid-flight → re-run the whole command from byte 0.

Scope

  • Detect transient errors (ECONNRESET, ETIMEDOUT, 5xx) in `tusPatch`
  • On error: call `tusHead` to read current Upload-Offset, resume from there
  • Configurable retry budget (default 3 attempts per chunk, total 10 min)
  • onProgress callback gets a "resumed from N bytes" hint

Success criteria

  • 500MB upload survives 1 network blip without restarting
  • Unit tests with mocked fetch for: 503-then-200, ECONNRESET-then-200, retry budget exhausted

Why P2

SIRE TXT files are typically small (<10MB). Matters more if someone uploads a giant ajustes-anteriores batch.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:sireSIRE Ventas/ComprasenhancementNew feature or requestpriority:p2Medium value, when needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions