{"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":85,"sourceCode":"// ErrBazaarRatingRateLimited 表示评分请求受到云端频率限制。\nvar ErrBazaarRatingRateLimited = errors.New(\"bazaar rating rate limited\")\n\n// ErrBazaarPackagePending 表示云端尚未同步包信息。\nvar ErrBazaarPackagePending = errors.New(\"bazaar package information has not synced yet\")\n\n// GetInstalledBazaarPackageRatings 获取指定已安装包的公开评分。\nfunc GetInstalledBazaarPackageRatings(ctx context.Context, pkgType string,\n\tpackageNames []string) (ratings map[string]*bazaar.PackageRating, eligiblePackageNames []string, err error) {\n\teligiblePackageNames, err = getInstalledOfficialBazaarPackageNames(ctx, pkgType, packageNames)\n\tif nil != err {\n\t\treturn nil, nil, err\n\t}\n\tif 0 == len(eligiblePackageNames) {\n\t\treturn map[string]*bazaar.PackageRating{}, []string{}, 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// GetInstalledBazaarPackageUserRatings 获取指定已安装官方包的当前用户评分。\nfunc GetInstalledBazaarPackageUserRatings(ctx context.Context, pkgType string,\n\tpackageNames []string) (userRatings map[string]int, eligiblePackageNames []string, err error) {\n\tif !isValidBazaarPackageType(pkgType) {\n\t\treturn nil, nil, errors.New(\"invalid package type\")\n\t}\n\tif bazaarPackageRatingBatchSize < len(packageNames) {\n\t\treturn nil, nil, errors.New(\"too many package names\")\n\t}\n\ttoken, err := bazaarRatingUserToken()\n\tif nil != err {\n\t\treturn nil, nil, err\n\t}\n\teligiblePackageNames, err = getInstalledOfficialBazaarPackageNames(ctx, pkgType, packageNames)","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/bazaar_rating.go#L67-L103","documentation":"GetInstalledBazaarPackageRatings returns this error when the public rating service reports that ratings are unavailable (bazaar.GetBazaarPackageRatings returns available=false), meaning it cannot fetch public ratings for the eligible packages at all. It signals a global unavailability of the ratings data source, not a problem with specific packages.","triggerScenarios":"Calling GetInstalledBazaarPackageRatings with at least one eligible installed official package while bazaar.GetBazaarPackageRatings reports the ratings cache/service as unavailable.","commonSituations":"Cloud/marketplace rating service outage; ratings index not yet built or downloaded on this instance; connectivity issues preventing the ratings bundle from loading.","solutions":["Retry later once the marketplace rating service is reachable again","Check network connectivity to the cloud server","Fall back to rendering packages without ratings in the UI"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Go\nratings, names, err := model.GetInstalledBazaarPackageRatings(ctx, pkgType, pkgs)\nif err != nil {\n    log.Warnf(\"ratings unavailable, rendering without ratings: %v\", err)\n    ratings = map[string]*bazaar.PackageRating{}\n}","preventionTips":["Design the marketplace UI to degrade gracefully without ratings","Monitor cloud rating service availability before bulk queries","Cache the last successful ratings snapshot for offline display"],"tags":["cloud","marketplace","availability"],"backgroundTag":"empty-api-response","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}