Skip to content
This repository was archived by the owner on Jul 28, 2026. It is now read-only.
This repository was archived by the owner on Jul 28, 2026. It is now read-only.

Upload fails with 404 on chunk PUT — no retry, entire upload lost #117

Description

@rubenhensen

Problem

During an upload to staging (fileshare.staging.postguard.eu), a single chunk PUT returned HTTP 404:

PUT https://fileshare.staging.postguard.eu/fileupload/e25a6d9e-35a3-404b-9bdc-2c7d8b3da904
[HTTP/2 404 121ms]

Error occurred during encryption: Error: JavaScript error: no further details

Uncaught (in promise) NetworkError: Error uploading chunk

The entire upload was lost — all progress gone, no way to resume.

Likely cause

The cryptify server expires unfinalized uploads after 15 minutes (store.rs purge task). If a large upload takes longer than that, or the connection stalls, the server-side state is purged and subsequent chunk PUTs return 404 because the UUID no longer exists.

Impact

  • For large files (multiple GiB over slow connections), this is likely to happen regularly
  • The user gets no warning that their upload timed out — just a generic error
  • All uploaded bytes are wasted

Suggested fixes

  1. Retry failed chunks — pg-js should retry transient failures (404, 5xx, network errors) with exponential backoff before giving up
  2. Extend or refresh the expiry — each successful chunk PUT should reset the 15-minute expiry timer on the server
  3. Better error messaging — distinguish "upload expired" (404) from other errors so the user understands what happened
  4. Resume support — allow the client to resume from the last successful chunk offset instead of starting over

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions