siyuan-note/siyuan · warning · ErrBazaarPackagePending

bazaar package information has not synced yet

Error message

bazaar package information has not synced yet

What it means

ErrBazaarPackagePending is a sentinel error indicating the cloud server has not yet synchronized the bazaar package's information, so the rating request cannot be served. It is returned by requestBazaarPackageRating when the cloud responds HTTP 503 with errorCode 'bazaarPackagePending', and the API layer maps it to the 'bazaarPackagePending' error code.

Solutions

  1. Wait and retry the rating request after the cloud has finished syncing the package
  2. Check errors.Is(err, model.ErrBazaarPackagePending) and treat it as a transient 'no rating yet' state instead of a hard failure
  3. Retry with exponential backoff via a bounded retry loop around the call

Example fix

// before
rating, avail, userRating, err := model.GetBazaarPackageRating(ctx, pkgType, name)
if err != nil { return err }
// after
rating, avail, userRating, err := model.GetBazaarPackageRating(ctx, pkgType, name)
if errors.Is(err, model.ErrBazaarPackagePending) {
    // package info not synced yet; show 'no rating'
    return nil
} else if err != nil {
    return err
}
Defensive patterns

Strategy: retry

Try / catch

// Go
if errors.Is(err, model.ErrBazaarPackagePending) {
    // transient: show 'not rated yet', schedule a retry with backoff
}

Prevention

When it happens

Trigger: Calling GetBazaarPackageRating, SetBazaarPackageRating, or requestBazaarPackageRating for a package whose info has not yet reached the cloud rating service; the cloud replies 503 Service Unavailable with errorCode=bazaarPackagePending.

Common situations: A package was just published or installed and the cloud-side rating record has not propagated yet; a newly synced marketplace backend; stale cloud cache after a package rename.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/8c3a00ec04095455. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/bazaar_rating.go:71

	Data T      `json:"data"`
}

type bazaarPackageUserRatingData struct {
	Rating int `json:"rating"`
}

type bazaarPackageSetRatingData struct {
	Rating          int                   `json:"rating"`
	RatingAvailable *bool                 `json:"ratingAvailable"`
	PublicRating    *bazaar.PackageRating `json:"publicRating"`
	Distribution    []int64               `json:"distribution"`
}

// ErrBazaarRatingRateLimited 表示评分请求受到云端频率限制。
var ErrBazaarRatingRateLimited = errors.New("bazaar rating rate limited")

// ErrBazaarPackagePending 表示云端尚未同步包信息。
var ErrBazaarPackagePending = errors.New("bazaar package information has not synced yet")

// GetInstalledBazaarPackageRatings 获取指定已安装包的公开评分。
func GetInstalledBazaarPackageRatings(ctx context.Context, pkgType string,
	packageNames []string) (ratings map[string]*bazaar.PackageRating, eligiblePackageNames []string, err error) {
	eligiblePackageNames, err = getInstalledOfficialBazaarPackageNames(ctx, pkgType, packageNames)
	if nil != err {
		return nil, nil, err
	}
	if 0 == len(eligiblePackageNames) {
		return map[string]*bazaar.PackageRating{}, []string{}, nil
	}
	ratings, available := bazaarRatingPublicPackageRatings(ctx, eligiblePackageNames)
	if !available {
		return nil, nil, errors.New("marketplace package ratings are unavailable")
	}
	return ratings, eligiblePackageNames, nil
}

View on GitHub (pinned to 9f775e8a12)