Skip to content

Conversation

@fnando
Copy link
Member

@fnando fnando commented Aug 6, 2025

What

Swaps the version checking. This fixes the case where latest version is cached and the current version is greater than the cached value, showing the upgrade message to users that don't need it.

Why

Close #2081.

Known limitations

N/A

@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Aug 6, 2025
@fnando fnando self-assigned this Aug 6, 2025
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX Aug 6, 2025
Copy link
Collaborator

@elizabethengelman elizabethengelman left a comment

Choose a reason for hiding this comment

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

Approving this because it looks good to me as a fix for the first issue!

when I was on 22.8.2, it didn't ask me to upgrade to the latest 23

I am not sure I fully understand how this will address the second issue, because this makes it seem like the executable still thought it was at version 22.1.0. 🤔 Which would still be an issue, even not considering the potential crates.io caching, right?

after upgrading it to the latest 23, I get the following error: • A new release of stellar-cli is available: 22.1.0 -> 22.8.2 which is incorrect

@fnando
Copy link
Member Author

fnando commented Aug 6, 2025

The asking to upgrade part is tricky, because it depends on execution time. Even if cache was disabled completely, commands could still not show it, so I'm not going to bother with it.

This fix only handles the case where the latest installed cli wouldn't ever fail if cache was stale (e.g. v23 wouldn't fail if latest cached was v22). I think there's something fishy on the reported CLI version, because it returned 22.1.0, whether user error or something like brew not having finished installed the latest version.

@fnando fnando enabled auto-merge (squash) August 6, 2025 21:35
@fnando fnando merged commit cd468dc into main Aug 6, 2025
35 checks passed
@fnando fnando deleted the swap-version-check branch August 6, 2025 21:56
@github-project-automation github-project-automation bot moved this from Needs Review to Done in DevX Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

stellar-cli upgrade check

3 participants