{"record":{"id":"2909c4e77a80cf54","repo":"siyuan-note/siyuan","slug":"marketplace-package-ratings-are-unavailable","errorCode":null,"errorMessage":"marketplace package ratings are unavailable","messagePattern":"marketplace package ratings are unavailable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kernel/model/bazaar_rating.go","lineNumber":105,"sourceCode":"\t\t\tcontinue\n\t\t}\n\t\tseen[packageName] = true\n\t\tnames = append(names, packageName)\n\t}\n\tif 0 == len(names) {\n\t\treturn map[string]*bazaar.PackageRating{}, []string{}, nil\n\t}\n\n\teligiblePackageNames, err = bazaarRatingExistingPackageNames(ctx, pkgType, names)\n\tif nil != err {\n\t\treturn nil, nil, err\n\t}\n\tif 0 == len(eligiblePackageNames) {\n\t\treturn map[string]*bazaar.PackageRating{}, eligiblePackageNames, nil\n\t}\n\tratings, available := bazaarRatingPublicPackageRatings(ctx, eligiblePackageNames)\n\tif !available {\n\t\treturn nil, nil, errors.New(\"marketplace package ratings are unavailable\")\n\t}\n\treturn ratings, eligiblePackageNames, nil\n}\n\n// GetBazaarPackageRating 获取已安装官方包的公开评分和当前用户评分。\nfunc GetBazaarPackageRating(ctx context.Context, pkgType, packageName string) (rating *bazaar.PackageRating,\n\tratingAvailable bool, userRating int, err error) {\n\ttoken, err := bazaarRatingValidatePackage(ctx, pkgType, packageName)\n\tif nil != err {\n\t\treturn nil, false, 0, err\n\t}\n\n\tdata := bazaarPackageUserRatingData{}\n\terr = requestBazaarPackageRating(ctx, \"/apis/siyuan/bazaar/getBazaarPackageRating\", map[string]any{\n\t\t\"token\":       token,\n\t\t\"packageName\": packageName,\n\t}, &data)\n\tif nil != err {","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/afa823b6b4e4f183511e0bc0a3be93caa94c7c97/kernel/model/bazaar_rating.go#L87-L123","documentation":"Error returned by model.GetInstalledBazaarPackageRatings (kernel/model/bazaar_rating.go:105) when bazaarRatingPublicPackageRatings (bazaar.GetBazaarPackageRatings) reports the public rating data as unavailable after the package names were already confirmed eligible on the marketplace. It marks the ratings subsystem being down or unreachable while the rest of the bazaar API works, so the batch call fails as a whole instead of returning partial data.","triggerScenarios":"Calling /api/bazaar/getInstalledBazaarPackageRatings while the cloud rating data source is unreachable or returns no usable payload: outage of the ratings backend, CDN failure, or network paths that reach the marketplace metadata but not the ratings service.","commonSituations":"Bazaar browsing works but the rating panel errors out; regional network interference dropping specific cloud endpoints; transient outages right after a cloud deployment.","solutions":["Treat ratings as optional data: catch this error and degrade to a UI without rating stars instead of blocking the marketplace view","Retry later; the unavailable state is server-side and resolves with the service","Check general cloud connectivity (account sync endpoint) to distinguish a full outage from a ratings-only one"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"ratings, eligible, err := model.GetInstalledBazaarPackageRatings(ctx, pkgType, names)\nif err != nil && strings.Contains(err.Error(), \"ratings are unavailable\") {\n    ratings, eligible = map[string]*bazaar.PackageRating{}, []string{} // render without stars\n} else if err != nil {\n    return err\n}","preventionTips":["Design rating display as an enhancement: absent ratings must never break the marketplace view","Cache the last successful ratings payload to ride out short unavailability windows"],"tags":["marketplace","ratings","unavailable","cloud","degradation"],"backgroundTag":"upstream-service-unavailable","analyzedSha":"afa823b6b4e4f183511e0bc0a3be93caa94c7c97","analyzedAt":"2026-08-18T17:04:10.865Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}