From 35f790f06bfcfffa2179c9ba96427f13ded55f58 Mon Sep 17 00:00:00 2001 From: Philipp Wagner Date: Tue, 4 Aug 2026 20:49:06 +0200 Subject: [PATCH] Fix stale Beta tab showing a superseded prerelease GitHub never clears the prerelease flag once a beta ships as stable, so the latest prerelease can be older than the latest stable release. Compare publish dates and fall back to the empty state when stable is newer. Assisted by Claude Sonnet 5 --- website/src/_data/beta.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/website/src/_data/beta.js b/website/src/_data/beta.js index b7d1c3d..2a000d9 100644 --- a/website/src/_data/beta.js +++ b/website/src/_data/beta.js @@ -12,6 +12,13 @@ const RELEASES_URL = `https://github.com/${REPO}/releases`; * prerelease flag, but that flag is exactly what this workflow sets, and * nothing else in this repository publishes prereleases, so it is a safe * signal to use here. + * + * A prerelease flag alone isn't enough though: GitHub never clears + * `prerelease` once the corresponding Stable version has actually shipped, + * so the latest prerelease can be stale (e.g. beta-1.41-rc04 published + * 2026-06-30, followed by Stable v1.41.0 on 2026-07-01). If the newest + * Stable release is more recent than the newest prerelease, there is no + * current beta and the empty state should be shown instead. */ async function fetchLatestBetaRelease() { const headers = { Accept: "application/vnd.github+json" }; @@ -29,7 +36,18 @@ async function fetchLatestBetaRelease() { const releases = await res.json(); - return releases.find((release) => release.prerelease && !release.draft) || null; + const latestBeta = releases.find((release) => release.prerelease && !release.draft) || null; + const latestStable = releases.find((release) => !release.prerelease && !release.draft) || null; + + if (!latestBeta) { + return null; + } + + if (latestStable && latestStable.published_at > latestBeta.published_at) { + return null; + } + + return latestBeta; } catch (err) { console.warn( `[beta] Could not load the latest beta release. ` +