{
  "id": 20332041,
  "title": "Node.js Browser Download Link 404s — Object Storage Export Job Race Conditions",
  "url": "https://urgent.news/2026/11/16/node-js-browser-download-link-404s-object-storage-export-job-race",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-16T21:20:45.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/ethanbrooks1647/nodejs-browser-download-link-404s-object-storage-export-job-race-conditions-34n8"
  },
  "original_language": "en",
  "account": "When a tenant initiates an export of its data in a healthtech system that utilizes Node.js and object storage, the export worker handles the process of creating a ZIP archive of the requested data. The crucial step is to ensure that the export record contains the exact object identity of the completed archive before deriving a browser download link from it. This avoids confusion that can arise from a 404 error on the object storage when attempting to access the download link.\n\nThe process begins with the export worker storing the completed archive in object storage and recording the archive's key and version in a durable database record. This serves as an immutable identifier for the completed archive, ensuring that the browser download link points to the correct location. The link service reads the ready records specific to the authenticated tenant, verifying that the object identity has been correctly persisted.\n\nThe race condition between the export worker and the queue or retry mechanism can lead to a situation where the browser link points to a non-existent archive. This can happen due to a missing tenant segment, URL encoding changes, or retry suffixes in the generated link. To mitigate this, the system should wait for the finalization of the export before generating the download link. This involves checking the record's lifecycle state and ensuring that the storage write has completed and the identity was persisted in the durable database.",
  "summary": "Short answer: treat a tenant export as unpublished until the worker has stored the exact completed-object identity in a durable record. A browser download link should be derived from that record, never from a filename guessed when the job was queued. This turns a confusing object-storage 404 into a small set of inspectable state transitions. For a healthtech system that stores product images and…",
  "key_points": [
    "Export worker stores completed archive in object storage.",
    "Race condition causes browser link to point to non-existent archive.",
    "System should wait for finalization before generating download link."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}