Closed bug report

release list omits asset-only versions (API disagrees with the page's /releases tab)

Colby Knox · 2mo ago ·closed by Colby Knox

GET /api/pages/:owner/:slug/releases returns {"releases": []} for a page whose release assets exist, download fine, and are listed on the page's own /releases tab. Reported by Arav Karnik (basic-parts rollout), reproduced today on prod:

$ adom-wiki release list aravk/in-s42atr --json
{"status":"ok","data":{"releases":[]}}
$ curl -s https://wiki.adom.inc/api/packages/aravk/in-s42atr/1.0.0/assets
{"owner":"aravk","slug":"in-s42atr","version":"1.0.0","assets":[{"filename":"IN-S42ATR-datasheet.pdf", ... "download_url":"/download/aravk/in-s42atr/1.0.0/IN-S42ATR-datasheet.pdf"}]}
$ curl -s -o /dev/null -w "%{http_code}" https://wiki.adom.inc/download/aravk/in-s42atr/1.0.0/IN-S42ATR-datasheet.pdf
200

The HTML tab (/aravk/in-s42atr/releases) shows 1.0.0 with the PDF, so the API disagrees with its own web page.

Cause (server.js, the pageRoute("get", "/releases") handler, the #76 join): the handler builds assetsByVersion from assetsLib.listReleaseAssets(page.id) but only emits listReleases(db, page.id).map(r => ({...r, assets})). A version that exists ONLY as uploaded assets (release upload with no release create / no tag-backed row, which is exactly how a datasheet-as-asset lands) is never emitted. renderReleases uses gatherVersions(page), which unions them, hence the HTML/API split.

Fix suggestion: after the map, append the asset-only versions:

for (const [version, assets] of assetsByVersion) {
  if (!releases.some(r => r.version === version)) out.push({ version, assets, asset_only: true, created_at: assets[0]?.created_at || null });
}

(asset_only: true lets the CLI label them; sort by version desc with the rest.) No CLI change needed for the fix to reach every client: release list passes the array through. The CLI will add an info hint on an empty list pointing at release assets <ref> <version> in its next patch, for registries that predate the fix.

2 Replies

Colby Knox · 2mo ago

Server fix shipped and live on prod (tag ffbea05). The list only walked tag-backed release rows, so a version that exists purely as uploaded assets (a release upload with no release create) was dropped, though /download and the page /releases tab serve it. The asset-only versions are now appended after the map, flagged asset_only: true, carrying their downloadable assets. Verified on prod: uploaded an asset to a version with no release row, GET /releases lists it as asset_only with the asset. Regression test pins it. Leaving open for the CLI side (the RELEASE_LIST_EMPTY hint in 1.6.2, currently blocked by the GitHub Releases/Actions outage) to land.

Colby Knox · 2mo ago

Closing: both halves live and verified end to end on Arav's original repro.

  • Server (ffbea05): GET /api/pages/aravk/in-s42atr/releases now returns the datasheet version as {"version":"1.0.0","asset_only":true,"assets":[...]}.
  • CLI (adom-wiki 1.6.2, released 2026-08-17 17:47 UTC, 5/5 platforms): adom-wiki release list aravk/in-s42atr shows 1.0.0 (asset_only) with no hint at all; the RELEASE_LIST_EMPTY info hint (with cmd: release assets <ref> <version>) fires only on an empty list, as the fallback for registries that predate this fix.

Nothing left on either side.

Log in to reply.