Files
upl/TESTS.md
T
ddidderr 24ecdbd251 feat: persist upload creation metadata
Add the first upload API endpoint from PLAN.md. POST /api/uploads now
validates the requested file name, generates a server-owned upload id, creates
the staging and complete directory layout, and writes durable meta.json before
returning chunk scheduling details to the browser.

Keep filesystem layout knowledge in storage.rs so later chunk upload and
completion work can reuse the same boundary. API handlers translate storage
errors into JSON HTTP responses without leaking layout details into the router.

Document the new modules and UPL_DATA_DIR configuration, and extend TESTS.md
with the automated creation coverage.

Test Plan:
- just check

Refs: PLAN.md milestone 2
2026-05-30 16:57:48 +02:00

1.0 KiB

Test Scenarios

Keep this file as the reusable verification checklist while implementing PLAN.md.

Automated

  • just check
    • Runs formatting, all Rust tests, and clippy.
    • Current coverage:
      • GET / serves the static browser page.
      • GET /healthz reports ok.
      • POST /api/uploads creates meta.json and chunk directories.
      • POST /api/uploads rejects an empty file name.

Manual

These scenarios come from PLAN.md and should be retested as the matching features land.

  • Upload a small file in one pass.
  • Upload a file larger than one chunk.
  • Kill the browser tab mid-upload and resume.
  • Restart the Rust server mid-upload and resume.
  • Interrupt the network and resume.
  • Retry a duplicate chunk and confirm it is accepted idempotently.
  • Attempt an invalid chunk index and confirm it is rejected.
  • Attempt a wrong-size non-final chunk and confirm it is rejected.
  • Complete an upload and compare the final file with the source file:
sha256sum source-file data/complete/uploaded-file