Bug Description
GitHub-hosted addons fail to install/update when the user does not have a GitHub Personal Access Token configured. The downloaded zip file is invalid because WowUp receives JSON API metadata instead of the actual binary.
Root Cause
In the built v2.22.0 app, github-addon-provider always uses asset.url (the GitHub API URL, e.g. https://api.github.com/repos/.../releases/assets/12345) for the downloadUrl, regardless of whether a PAT is configured.
Without a PAT, getDownloadAuth() returns undefined (no Accept: application/octet-stream header). GitHub's API then returns a JSON metadata response instead of the binary content. This JSON gets saved as a .zip file, which fails to extract with:
Error: end of central directory record signature not found
The same issue affects release.json metadata fetching — WowUp receives API metadata about the asset instead of the actual release.json content, causing:
TypeError: Cannot read properties of undefined (reading 'find')
at getValidAssetFromMetadata
Affected Code
Three locations in the built main.js (corresponding to github-addon-provider.ts):
-
searchByUrl (initial install from URL):
// Built code uses:
downloadUrl: B?.url ?? ""
// Should be:
downloadUrl: B?.browser_download_url ?? ""
-
getById (updates/reinstalls):
// Built code uses:
downloadUrl: D?.url ?? ""
// Should be:
downloadUrl: D?.browser_download_url ?? ""
-
getReleaseMetadata (release.json fetch):
// Built code uses:
o = i.url
// Should be conditional:
o = r ? i.url : i.browser_download_url
Note
The source code on GitHub already contains a hasPat conditional (hasPat ? asset?.url : asset?.browser_download_url), but the v2.22.0 build does not include this fix. The built JS unconditionally uses asset.url.
Related
Reproduction
- Do NOT configure a GitHub PAT in WowUp-CF
- Install any GitHub-hosted addon by repo URL (e.g.
https://github.com/MattressPadley/WoW-PadleyUI)
- Observe
end of central directory record signature not found error in logs
- Observe
[DownloadFile] log line shows https://api.github.com/repos/.../releases/assets/... instead of https://github.com/.../releases/download/.../addon.zip
Workaround
Extract the app.asar, replace the three asset.url references with asset.browser_download_url in the minified JS, and repack.
Bug Description
GitHub-hosted addons fail to install/update when the user does not have a GitHub Personal Access Token configured. The downloaded zip file is invalid because WowUp receives JSON API metadata instead of the actual binary.
Root Cause
In the built v2.22.0 app,
github-addon-provideralways usesasset.url(the GitHub API URL, e.g.https://api.github.com/repos/.../releases/assets/12345) for thedownloadUrl, regardless of whether a PAT is configured.Without a PAT,
getDownloadAuth()returnsundefined(noAccept: application/octet-streamheader). GitHub's API then returns a JSON metadata response instead of the binary content. This JSON gets saved as a.zipfile, which fails to extract with:The same issue affects
release.jsonmetadata fetching — WowUp receives API metadata about the asset instead of the actualrelease.jsoncontent, causing:Affected Code
Three locations in the built
main.js(corresponding togithub-addon-provider.ts):searchByUrl(initial install from URL):getById(updates/reinstalls):getReleaseMetadata(release.json fetch):Note
The source code on GitHub already contains a
hasPatconditional (hasPat ? asset?.url : asset?.browser_download_url), but the v2.22.0 build does not include this fix. The built JS unconditionally usesasset.url.Related
Reproduction
https://github.com/MattressPadley/WoW-PadleyUI)end of central directory record signature not founderror in logs[DownloadFile]log line showshttps://api.github.com/repos/.../releases/assets/...instead ofhttps://github.com/.../releases/download/.../addon.zipWorkaround
Extract the
app.asar, replace the threeasset.urlreferences withasset.browser_download_urlin the minified JS, and repack.