From d3f051031fcc49ddd0e189c052390ede5580a67f Mon Sep 17 00:00:00 2001 From: Ruben Fricke Date: Wed, 18 Mar 2026 09:53:06 +0100 Subject: [PATCH] auto_update: Strip pre-release and build metadata from release notes URL (#48570) Without this fix, the zed.dev server doesn't recognize the version with metadata and redirects to /releases, which defaults to the Stable channel, so Preview users end up seeing Stable release notes. Closes #47539 Changes: - Strip pre and build metadata from the semver version in release_notes_url before constructing the path, so the URL becomes /releases/preview/0.218.0 instead of /releases/preview/0.218.0-beta.1+preview.131.68e98a53. - Standardized the ordering of pre/build clearing to pre-first across all 4 call sites (2 were build-first). Open question: With this fix, the URL now points to the specific version you're running (e.g. /releases/preview/0.218.0). An alternative would be to link to /releases/preview (no version) so users can see all Preview releases, including ones newer than what they have installed. I went with per-version linking since it matches the existing intent of the code, but happy to change it if the team prefers the other approach. Release Notes: - Fixed "View Release Notes" in Preview/Stable opening the wrong release channel page due to build metadata in the URL. --- crates/auto_update/src/auto_update.rs | 6 ++++-- crates/auto_update_ui/src/auto_update_ui.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/auto_update/src/auto_update.rs b/crates/auto_update/src/auto_update.rs index 9b9ccee3b695bebdb08706815bcb407c901e4b5f..964b07d87518d990a39d983d03a8cf90358cc5de 100644 --- a/crates/auto_update/src/auto_update.rs +++ b/crates/auto_update/src/auto_update.rs @@ -252,7 +252,9 @@ pub fn release_notes_url(cx: &mut App) -> Option { ReleaseChannel::Stable | ReleaseChannel::Preview => { let auto_updater = AutoUpdater::get(cx)?; let auto_updater = auto_updater.read(cx); - let current_version = &auto_updater.current_version; + let mut current_version = auto_updater.current_version.clone(); + current_version.pre = semver::Prerelease::EMPTY; + current_version.build = semver::BuildMetadata::EMPTY; let release_channel = release_channel.dev_name(); let path = format!("/releases/{release_channel}/{current_version}"); auto_updater.client.http_client().build_url(&path) @@ -750,8 +752,8 @@ impl AutoUpdater { fetched_version: Version, ) -> Result> { // For non-nightly releases, ignore build and pre-release fields as they're not provided by our endpoints right now. - installed_version.build = semver::BuildMetadata::EMPTY; installed_version.pre = semver::Prerelease::EMPTY; + installed_version.build = semver::BuildMetadata::EMPTY; let should_download = fetched_version > installed_version; let newer_version = should_download.then(|| VersionCheckType::Semantic(fetched_version)); Ok(newer_version) diff --git a/crates/auto_update_ui/src/auto_update_ui.rs b/crates/auto_update_ui/src/auto_update_ui.rs index 853ce4e7a332c5d93cc97ed8596c961ee8ed08a0..e613d3af68875267f6a678505b83d605b9f8425c 100644 --- a/crates/auto_update_ui/src/auto_update_ui.rs +++ b/crates/auto_update_ui/src/auto_update_ui.rs @@ -270,8 +270,8 @@ pub fn notify_if_app_was_updated(cx: &mut App) { if should_show_notification { cx.update(|cx| { let mut version = updater.read(cx).current_version(); - version.build = semver::BuildMetadata::EMPTY; version.pre = semver::Prerelease::EMPTY; + version.build = semver::BuildMetadata::EMPTY; let app_name = ReleaseChannel::global(cx).display_name(); if let Some(content) = announcement_for_version(&version) {