runtime: show promoted previews only once

This commit is contained in:
YXC0915 committed 2026-12-01 10:57:38 +08:00
1 parent 4a2bffd5d2
commit 43d793ec36
2 files changed
+6 -1

No files matched your search

+5 -1
View File
@@ -172,8 +172,12 @@ func (s Source) ListRemote(ctx context.Context, includeAlpha bool) ([]Remote, er
if err != nil {
return nil, err
}
stableCommits := make(map[string]bool, len(stable))
for _, r := range stable {
stableCommits[r.Commit] = true
}
for _, r := range previews {
if r.Channel == ChannelAlpha {
if r.Channel == ChannelAlpha && !stableCommits[r.Commit] {
stable = append(stable, r)
}
}
+1
View File
@@ -120,6 +120,7 @@ func TestDefaultSourceListsPreviewsFromRuntimeFork(t *testing.T) {
_ = json.NewEncoder(w).Encode([]ghRelease{
release("fork-preview", "2026-12-01T00:00:00Z", true),
release("fork-stable", "2026-12-01T01:00:00Z", false),
release("official-stable", "2026-12-01T02:00:00Z", true),
})
})
srv := httptest.NewServer(mux)