{"record":{"id":"9fe21e23426d20ea","repo":"different-ai/openwork","slug":"latest-mac-yml-is-missing-sha512","errorCode":null,"errorMessage":"latest-mac.yml is missing sha512.","messagePattern":"latest-mac\\.yml is missing sha512\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/app/src/app/lib/electron-alpha.ts","lineNumber":54,"sourceCode":"  return new URL(pathOrUrl, `${ELECTRON_ALPHA_RELEASE_BASE_URL}/`).toString();\n}\n\nexport function parseElectronLatestMacYml(\n  raw: string,\n  arch: \"arm64\" | \"x64\",\n): ElectronAlphaArtifact {\n  const version = parseYamlScalar(raw, \"version\");\n  const path = parseYamlScalar(raw, \"path\") ?? parseFirstFileUrl(raw);\n  const sha512 = parseYamlScalar(raw, \"sha512\");\n\n  if (!version) {\n    throw new Error(\"latest-mac.yml is missing version.\");\n  }\n  if (!path) {\n    throw new Error(\"latest-mac.yml is missing artifact path/url.\");\n  }\n  if (!sha512) {\n    throw new Error(\"latest-mac.yml is missing sha512.\");\n  }\n\n  return {\n    arch,\n    manifestUrl: ELECTRON_ALPHA_LATEST_MAC_YML_URL,\n    releaseUrl: ELECTRON_ALPHA_RELEASE_PAGE_URL,\n    url: resolveArtifactUrl(path),\n    path,\n    version,\n    sha512,\n  };\n}\n\nexport async function resolveElectronAlphaArtifact(\n  arch: \"arm64\" | \"x64\" = \"arm64\",\n): Promise<ElectronAlphaArtifact> {\n  const response = await desktopFetch(ELECTRON_ALPHA_LATEST_MAC_YML_URL, {\n    headers: { Accept: \"text/yaml, text/plain, */*\" },","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/app/lib/electron-alpha.ts#L36-L72","documentation":"The same manifest parser requires a non-empty `sha512` field, which electron includes in latest-mac.yml for download integrity verification. When the hash is missing the artifact is rejected because integrity cannot be validated. Thrown before any download is attempted.","triggerScenarios":"latest-mac.yml fetched from ELECTRON_ALPHA_LATEST_MAC_YML_URL has `version` and `path` but no `sha512` key — typically a hand-edited manifest, a publish tool that omits the hash, or a truncated response body.","commonSituations":"Manually regenerated manifests, third-party mirrors stripping the hash, custom publish scripts writing minimal YAML, or electron-builder version differences in hash fields.","solutions":["Inspect the raw manifest and verify the `sha512:` key exists and is non-empty.","Regenerate the manifest with the standard electron-builder publish flow so the hash is computed and written.","If a proxy/mirror strips fields, fetch the manifest from the canonical origin instead."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const text = await (await desktopFetch(ELECTRON_ALPHA_LATEST_MAC_YML_URL, { headers: { Accept: \"text/yaml, text/plain, */*\" } })).text();\nif (!/^sha512:\\s*[A-Za-z0-9+/=]+$/m.test(text)) throw new Error(\"Manifest lacks sha512; integrity check impossible.\");","typeGuard":"function hasSha512(m: { sha512?: unknown }): m is { sha512: string } {\n  return typeof m.sha512 === \"string\" && m.sha512.length > 0;\n}","tryCatchPattern":"try {\n  const artifact = await resolveElectronAlphaArtifact();\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"missing sha512\")) {\n    // treat manifest as corrupt; do not install unverified binaries\n    console.warn(\"Manifest missing integrity hash; update aborted.\");\n  } else throw err;\n}","preventionTips":["Never hand-edit latest-mac.yml; always regenerate via electron-builder publish.","Post-release CI assertion: sha512 present and base64-decodable.","Avoid mirrors/proxies that may strip manifest fields."],"tags":["parsing","integrity","sha512","electron-updater"],"backgroundTag":"update-manifest-missing-field","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}