Skip to content

fix(domain): hide stale rejected preview when newer version published #488

@XiaoSeS

Description

@XiaoSeS

Problem

When a skill had an earlier REJECTED version and a later PUBLISHED version, the my-skills list showed both "已发布" and "已拒绝" badges because ownerPreviewVersion pointed to the stale rejected version.

Example

  • v1.0.0 REJECTED on 2026-03-15
  • v2.0.0 PUBLISHED on 2026-03-16

The UI incorrectly showed both badges, confusing the owner.

Solution

Changed SkillLifecycleProjectionService to filter out non-published versions older than the published one. Only versions newer than the published version are surfaced as the owner preview, treating older rejected attempts as settled history.

Changes

  • Refactored projectForViewer and projectForOwnerSummary to use new buildProjection helper
  • Replaced resolveOwnerPendingPreview and resolveNewestNonPublishedVersion with resolveNewerNonPublishedVersion that filters by recency
  • Added test case covering the stale rejected scenario

Origin

Synced from SAAS commit c9eefa93fix(domain): hide stale rejected preview when newer version published

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeffort/l大改动或高风险改动,需要 maintainer 负责 / Large or risky change requiring maintainer ownership.priority/p3低优先级 / Low priority triage bucket.triage/needs-info需要补充更多信息后才能分流 / Issue needs more detail before it can be routed.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions