{"record":{"id":"570ed8407793c294","repo":"different-ai/openwork","slug":"recovery-download-failed-with-http-response-stat","errorCode":null,"errorMessage":"Recovery download failed with HTTP ${response.status}.","messagePattern":"Recovery download failed with HTTP (.+?)\\.","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/desktop/electron/recovery.mjs","lineNumber":195,"sourceCode":"  }\n  return releases;\n}\n\nexport function recoveryVersionMarkers(installedVersion, persistedState) {\n  const currentVersion = stableVersion(installedVersion);\n  const persistedCurrent = stableVersion(persistedState?.currentVersion);\n  const persistedPrevious = stableVersion(persistedState?.previousVersion);\n  return {\n    currentVersion,\n    previousVersion: persistedCurrent && persistedCurrent !== currentVersion\n      ? persistedCurrent\n      : persistedPrevious,\n  };\n}\n\nexport async function cacheVerifiedRecoveryArtifact({ app, artifact, fetchArtifact }) {\n  const response = await fetchArtifact(artifact.url);\n  if (!response.ok) throw new Error(`Recovery download failed with HTTP ${response.status}.`);\n  const bytes = Buffer.from(await response.arrayBuffer());\n  const checksum = createHash(\"sha512\").update(bytes).digest(\"base64\");\n  if (checksum !== artifact.sha512) throw new Error(\"Recovery installer checksum did not match its signed manifest.\");\n  const cacheDirectory = path.join(app.getPath(\"userData\"), RECOVERY_CACHE_DIRECTORY);\n  const stagingDirectory = `${cacheDirectory}.staging`;\n  const backupDirectory = `${cacheDirectory}.backup`;\n  const fileName = path.basename(new URL(artifact.url).pathname);\n  await rm(stagingDirectory, { recursive: true, force: true });\n  await mkdir(stagingDirectory, { recursive: true });\n  await writeFile(path.join(stagingDirectory, fileName), bytes);\n  await writeFile(\n    path.join(stagingDirectory, \"metadata.json\"),\n    `${JSON.stringify({ ...artifact, checksum, fileName }, null, 2)}\\n`,\n    \"utf8\",\n  );\n  await rm(backupDirectory, { recursive: true, force: true });\n  let previousMoved = false;\n  try {","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/desktop/electron/recovery.mjs#L177-L213","documentation":"Error \"Recovery download failed with HTTP ${response.status}.\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at apps/desktop/electron/recovery.mjs:195 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}