Skip to content

fix(registry): prevent duplicate -stable suffix in Flutter download URLs#7872

Merged
jdx merged 4 commits intomainfrom
fix/flutter-url-stable-suffix
Jan 28, 2026
Merged

fix(registry): prevent duplicate -stable suffix in Flutter download URLs#7872
jdx merged 4 commits intomainfrom
fix/flutter-url-stable-suffix

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Jan 28, 2026

Summary

  • Fixes malformed Flutter download URLs that contained duplicate -stable suffix
  • Example: flutter_linux_3.22.1-stable-stable.tar.xzflutter_linux_3.22.1-stable.tar.xz

Problem

The mise-versions.jdx.dev endpoint has inconsistent data:

  • Newer versions: "3.38.8" (clean, no suffix)
  • Older versions: "3.22.1-stable" (includes -stable suffix)

When the URL template already has -stable hardcoded and a version includes the suffix, it produces invalid URLs like flutter_linux_3.22.1-stable-stable.tar.xz.

Solution

Use Tera's replace filter to strip any existing -stable suffix before the template adds it back:

url = "...flutter_linux_{{ version | replace(from='-stable', to='') }}-stable.tar.xz"

This ensures correct URLs regardless of whether the version includes the channel suffix.

Fixes: #7863

Test plan

  • Added e2e test test_http_flutter_url (runs in ~5s)
  • Verified mise install flutter@3.22.1 produces correct URL
  • Verified mise ls-remote flutter works correctly

🤖 Generated with Claude Code


Note

Ensures Flutter download URLs are constructed correctly across platforms and versions.

  • Consolidates Flutter URL templates in registry/flutter.toml, using {{ version | replace(from="-stable", to="") }}-stable to avoid duplicate suffixes
  • Adds unified default URL for macOS/Windows with arch() mapping; updates Linux .tar.xz URLs and adds a linux-arm64 template
  • Adds e2e test e2e/backend/test_http_flutter_url verifying ls-remote parsing and mise install flutter@3.22.1 --dry-run resolves without duplicate -stable

Written by Cursor Bugbot for commit 230aee4. This will update automatically on new commits. Configure here.

The mise-versions.jdx.dev endpoint has inconsistent data where older
Flutter versions include "-stable" suffix (e.g., "3.22.1-stable") while
newer versions don't (e.g., "3.38.8"). When the URL template already
has "-stable" hardcoded, versions with the suffix produce malformed
URLs like "flutter_linux_3.22.1-stable-stable.tar.xz".

This fix uses Tera's replace filter to strip any existing "-stable"
suffix before the template adds it back, ensuring correct URLs
regardless of version format.

Fixes: #7863

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 28, 2026 15:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in Flutter download URL construction where versions containing a -stable suffix would result in malformed URLs with duplicate suffixes (e.g., flutter_linux_3.22.1-stable-stable.tar.xz).

Changes:

  • Added Tera replace filter to strip existing -stable suffix from versions before appending it in URL templates
  • Added e2e test to verify correct URL construction and prevent regression

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
registry/flutter.toml Updated URL templates for all platforms to use replace filter, preventing duplicate -stable suffixes
e2e/backend/test_http_flutter_url Added e2e test verifying Flutter version listing and installation with problematic version

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jdx jdx enabled auto-merge (squash) January 28, 2026 15:15
@jdx jdx disabled auto-merge January 28, 2026 15:20
@jdx jdx enabled auto-merge (squash) January 28, 2026 15:20
- Use single default URL with os()/arch() functions for macos/windows
- Only keep platform-specific override for linux (different extension)
- Reduces 4 platform URLs to 1 default + 1 linux-specific

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@jdx jdx disabled auto-merge January 28, 2026 15:35
Address review feedback: linux-arm64 would have fallen back to the
default .zip URL format. While Flutter doesn't officially provide
linux-arm64 builds, this ensures the correct archive format is used
if/when support is added.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Jan 28, 2026

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.1.8 x -- echo 20.8 ± 0.9 19.4 28.2 1.00
mise x -- echo 21.7 ± 0.6 20.5 26.4 1.04 ± 0.05

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.1.8 env 20.1 ± 0.4 19.2 24.0 1.00
mise env 20.7 ± 0.5 19.5 23.0 1.03 ± 0.03

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.1.8 hook-env 20.2 ± 0.4 19.4 22.3 1.00
mise hook-env 21.0 ± 0.9 20.0 33.9 1.04 ± 0.05

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.1.8 ls 17.9 ± 0.4 17.2 20.4 1.00
mise ls 18.3 ± 0.4 17.5 20.3 1.02 ± 0.03

xtasks/test/perf

Command mise-2026.1.8 mise Variance
install (cached) 113ms 113ms +0%
ls (cached) 68ms 69ms -1%
bin-paths (cached) 72ms 73ms -1%
task-ls (cached) 290ms 291ms +0%

@jdx jdx enabled auto-merge (squash) January 28, 2026 15:48
@jdx jdx merged commit 283332c into main Jan 28, 2026
35 checks passed
@jdx jdx deleted the fix/flutter-url-stable-suffix branch January 28, 2026 15:56
mise-en-dev added a commit that referenced this pull request Jan 28, 2026
### 🚀 Features

- **(doctor)** add backend mismatch warnings by @jdx in
[#7847](#7847)
- **(http)** add rename_exe support for archive extraction by @jdx in
[#7874](#7874)
- **(http)** send x-mise-ci header for CI environment tracking by @jdx
in [#7875](#7875)
- **(install)** auto-install plugins from [plugins] config section by
@jdx in [#7856](#7856)
- **(registry)** add vercel by @mikecurtis in
[#7844](#7844)
- **(task)** support glob patterns in task_config.includes by @jdx in
[#7870](#7870)
- **(task)** add task templates for reusable task definitions by @jdx in
[#7873](#7873)

### 🐛 Bug Fixes

- **(backend)** change registry mismatch log from info to debug by @jdx
in [#7858](#7858)
- **(ci)** use squash merge for auto-merge-release workflow by @jdx in
[7e5e71e](7e5e71e)
- **(ci)** remove --auto flag to merge immediately when CI passes by
@jdx in
[23ed2ed](23ed2ed)
- **(github)** select platform-matching provenance file for SLSA
verification by @jdx in [#7853](#7853)
- **(go)** filter out version "1" from available versions by @jdx in
[#7871](#7871)
- **(install)** skip CurDir components when detecting archive structure
by @jdx in [#7868](#7868)
- **(pipx)** ensure Python minor version symlink exists for postinstall
hooks by @jdx in [#7869](#7869)
- **(registry)** prevent duplicate -stable suffix in Flutter download
URLs by @jdx in [#7872](#7872)
- **(task)** pass env to usage parser for env-backed arguments by @jdx
in [#7848](#7848)
- **(task)** propagate MISE_ENV to child tasks when using -E flag by
@jdx in
[06ee776](06ee776)
- **(vfox-dotnet)** use os.execute() to fix Windows installation by
@prodrigues1912 in [#7843](#7843)

### 📚 Documentation

- update cache-behavior with env_cache information by @jdx in
[#7849](#7849)

### ◀️ Revert

- remove task inheritance from parent configs in monorepos by @jdx in
[#7851](#7851)
- Revert "fix(ci): remove --auto flag to merge immediately when CI
passes" by @jdx in
[0606187](0606187)

### 📦 Registry

- add mago
([aqua:carthage-software/mago](https://github.com/carthage-software/mago))
by @scop in [#7845](#7845)

### Chore

- **(ci)** auto-merge release branch into main daily at 4am CST by @jdx
in [#7852](#7852)

### New Contributors

- @mikecurtis made their first contribution in
[#7844](#7844)
- @prodrigues1912 made their first contribution in
[#7843](#7843)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants