{"record":{"id":"8f3060a017edcd5c","repo":"paperclipai/paperclip","slug":"this-exact-package-was-already-imported-by-a-compl-8f3060","errorCode":null,"errorMessage":"This exact package was already imported by a completed transfer. Re-export the package to import it again.","messagePattern":"This exact package was already imported by a completed transfer\\. Re-export the package to import it again\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ui/src/pages/CompanyImport.tsx","lineNumber":943,"sourceCode":"    // The whole file is read once here for hashing; parts are later uploaded\n    // as Blob slices of the File, so this buffer is not retained past hashing.\n    const manifest = await buildImportTransferManifest(await file.arrayBuffer());\n    transferManifestRef.current = { file, manifest };\n    return manifest;\n  }\n\n  /**\n   * Declare (or resume) the transfer for this file and upload every part the\n   * server reports missing, sequentially with per-part retries. Resolves with\n   * the transfer id once the server holds every part.\n   */\n  async function uploadImportTransfer(file: File): Promise<string> {\n    const manifest = await ensureTransferManifest(file);\n    const created = await companiesApi.importTransferCreate(manifest);\n    if (created.alreadyCompleted) {\n      // The server keys transfers by content, and this exact zip already\n      // finished an apply — its parts are gone, so it cannot be re-run.\n      throw new Error(\n        \"This exact package was already imported by a completed transfer. Re-export the package to import it again.\",\n      );\n    }\n    const missing = new Set(created.missingParts);\n    let uploadedParts = manifest.parts.length - missing.size;\n    let uploadedBytes = manifest.parts.reduce(\n      (sum, part) => (missing.has(part.index) ? sum : sum + part.byteSize),\n      0,\n    );\n    try {\n      setTransferProgress({\n        uploadedParts,\n        totalParts: manifest.parts.length,\n        uploadedBytes,\n        totalBytes: manifest.totalBytes,\n      });\n      for (const part of manifest.parts) {\n        if (!missing.has(part.index)) continue;","sourceCodeStart":925,"sourceCodeEnd":961,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/ui/src/pages/CompanyImport.tsx#L925-L961","documentation":"Idempotency guard in the import transfer flow: the server reports that a completed transfer with this exact content hash already exists, so the client refuses to re-upload/re-import the identical package. Re-exporting the package produces a new hash and is required to import again.","triggerScenarios":"Thrown at ui/src/pages/CompanyImport.tsx:943 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-export the company package from the source to get a new package identity, then import it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}