{"record":{"id":"c5ebeed80970d564","repo":"different-ai/openwork","slug":"den-returned-an-invalid-desktop-release-inventory","errorCode":null,"errorMessage":"Den returned an invalid desktop release inventory.","messagePattern":"Den returned an invalid desktop release inventory\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/app/src/react-app/domains/settings/state/electron-updater-state.ts","lineNumber":402,"sourceCode":"        onReleaseChannelChange(activeReleaseChannel);\n        await bridge.setChannel?.(activeReleaseChannel);\n        if (!isCurrentRequest()) return;\n      }\n      if (manual && activeReleaseChannel === \"stable\") {\n        const channelState = await bridge.getChannel?.();\n        if (!isCurrentRequest()) return;\n        const currentVersion = channelState?.currentVersion ?? appVersion;\n        if (!currentVersion) {\n          throw new Error(\"Could not determine the installed OpenWork version.\");\n        }\n\n        const selection = await resolveFreshStableDesktopUpdate({\n          currentVersion,\n          refreshDesktopConfig,\n        });\n        if (!isCurrentRequest()) return;\n        if (!selection) {\n          throw new Error(\"Den returned an invalid desktop release inventory.\");\n        }\n        if (selection.kind === \"blocked\") {\n          setUpdateStatus({\n            state: \"blocked\",\n            lastCheckedAt: Date.now(),\n            version: selection.latestPublishedVersion,\n            message: t(\"settings.update_blocked_org\", undefined, {\n              version: selection.latestPublishedVersion,\n            }),\n          });\n          return;\n        }\n        if (selection.kind === \"current\") {\n          setUpdateStatus({\n            state: \"idle\",\n            lastCheckedAt: Date.now(),\n            version: selection.latestPublishedVersion,\n          });","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/domains/settings/state/electron-updater-state.ts#L384-L420","documentation":"After resolving the installed version, the stable-channel manual update check calls resolveFreshStableDesktopUpdate. A null return means Den's desktop release inventory could not be resolved into a usable selection (not merely 'no update' — that would be a valid selection object). The code treats null as an invalid inventory and throws so the UI doesn't silently claim 'up to date' on bad data.","triggerScenarios":"Manual update check when resolveFreshStableDesktopUpdate returns null: refreshDesktopConfig fails, Den returns malformed/empty desktop release data, or the config fetch is unavailable at that moment.","commonSituations":"Den server unreachable or returning errors; release channel config not yet synced; malformed desktop-config response after a Den-side change; first launch before cloud config has been fetched.","solutions":["Retry the update check; transient Den/config fetch failures resolve on retry.","Verify network connectivity and that the Den/desktop-config endpoint is healthy.","Check refreshDesktopConfig: ensure it is wired and the cloud config contains valid desktop release entries.","Inspect the Den release inventory payload for schema changes breaking resolveFreshStableDesktopUpdate."],"exampleFix":"// before\nif (!selection) {\n  throw new Error(\"Den returned an invalid desktop release inventory.\");\n}\n// after\nif (!selection) {\n  const config = await refreshDesktopConfig();\n  console.warn(\"desktop release inventory invalid; config keys:\", Object.keys(config ?? {}));\n  throw new Error(\"Den returned an invalid desktop release inventory.\");\n}","handlingStrategy":"retry","validationCode":"const config = await refreshDesktopConfig();\nif (!config || !Array.isArray(config.desktopReleases) || config.desktopReleases.length === 0) {\n  // skip check; Den inventory not ready\n}","typeGuard":null,"tryCatchPattern":"try {\n  await checkForUpdates({ manual: true });\n} catch (err) {\n  if (err.message.includes(\"invalid desktop release inventory\")) scheduleUpdateRetry(30_000);\n  else throw err;\n}","preventionTips":["Cache the last good release inventory and fall back to it when Den returns bad data","Retry config refresh with backoff before surfacing the error","Monitor the Den desktop-config endpoint for schema changes"],"tags":["updater","den-server","release-inventory","network"],"backgroundTag":"invalid-server-response","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}