{"record":{"id":"18ad91023a6547ab","repo":"siyuan-note/siyuan","slug":"github-releases-are-empty","errorCode":null,"errorMessage":"GitHub releases are empty","messagePattern":"GitHub releases are empty","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/updater_release.go","lineNumber":252,"sourceCode":"func fetchGitHubReleases(ctx context.Context) ([]*githubRelease, error) {\n\treleases := []*githubRelease{}\n\trequest := httpclient.NewCloudRequest30s().\n\t\tSetContext(ctx).\n\t\tSetHeader(\"Accept\", \"application/vnd.github+json\").\n\t\tSetHeader(\"X-GitHub-Api-Version\", \"2022-11-28\").\n\t\tSetSuccessResult(&releases)\n\tresponse, err := request.Get(githubReleasesURL)\n\tif err != nil {\n\t\tlogging.LogErrorf(\"get GitHub releases failed: %s\", err)\n\t\treturn nil, err\n\t}\n\tif 200 != response.StatusCode {\n\t\terr = fmt.Errorf(\"get GitHub releases failed: %d\", response.StatusCode)\n\t\tlogging.LogError(err.Error())\n\t\treturn nil, err\n\t}\n\tif 0 == len(releases) {\n\t\treturn nil, errors.New(\"GitHub releases are empty\")\n\t}\n\n\tgithubReleasesLock.Lock()\n\tcachedGitHubReleases = releases\n\tgithubReleasesCacheTime = time.Now().Unix()\n\tgithubReleasesLock.Unlock()\n\treturn releases, nil\n}\n\nfunc selectGitHubRelease(releases []*githubRelease, channel string) *githubRelease {\n\tvar selected *githubRelease\n\tfor _, release := range releases {\n\t\tif nil == release || release.Draft || !isReleaseAllowed(channel, release.TagName) {\n\t\t\tcontinue\n\t\t}\n\t\tif nil == selected || 0 < semver.Compare(normalizeReleaseVersion(release.TagName), normalizeReleaseVersion(selected.TagName)) {\n\t\t\tselected = release\n\t\t}","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/updater_release.go#L234-L270","documentation":"Returned by fetchGitHubReleases(ctx) when the GitHub API responds 200 but the decoded releases slice is empty. The endpoint (api.github.com/repos/siyuan-note/siyuan/releases?per_page=100) returned zero releases. For an actively maintained repo this is anomalous and usually indicates a transient API anomaly or an unexpected response shape.","triggerScenarios":"GitHub API returned a 200 with an empty array (rare). The response was 200 but the JSON shape changed, so the SetSuccessResult(&releases) decode populated nothing without error. A proxy or interceptor returned an empty 200 body.","commonSituations":"Transient GitHub API glitch. A corporate proxy returning an empty 200 for the API call. A future deprecation of the v3 releases shape without a matching schema in githubRelease structs.","solutions":["Retry with force=true after a short wait to bypass cache and refetch.","Switch to the stable channel which uses the independent rhy cloud endpoint.","If persistent, manually verify the GitHub releases page is populated and check for proxy interception."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Retry once with a force refresh; fall back to stable channel.\nreleases, err := getGitHubReleases(ctx, true)\nif err != nil {\n    logging.LogWarnf(\"github releases unavailable (%s); using stable channel\", err)\n    return getStableUpdateRelease(true)\n}","preventionTips":["Fall back to the stable rhy endpoint when the GitHub API misbehaves.","Don't treat an empty list as 'no updates' — it's an anomaly worth retrying.","Log the raw response for diagnosis when this recurs."],"tags":["update","github-api","network","empty-response"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}