Skip to content

fix(update): correct inverted version comparison in update nagger#3347

Merged
szokeasaurusrex merged 3 commits into
getsentry:masterfrom
syf2211:fix/3290-inverted-update-nagger-version-comparison
Jun 26, 2026
Merged

fix(update): correct inverted version comparison in update nagger#3347
szokeasaurusrex merged 3 commits into
getsentry:masterfrom
syf2211:fix/3290-inverted-update-nagger-version-comparison

Conversation

@syf2211

@syf2211 syf2211 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix the inverted semver comparison in LastUpdateCheck::is_outdated() so the update nagger correctly prompts when a newer release is available.

Motivation

Fixes #3290

When the running CLI version is older than the latest fetched release (e.g. running 3.3.0 with fetched 3.4.1), the update nagger never showed because the comparison checked release < running instead of running < release.

Changes

  • Flip the version comparison in is_outdated() to VERSION < release_v
  • Add four unit tests covering outdated, up-to-date, dev-ahead, and stale-cache scenarios
  • Add CHANGELOG entry under Unreleased → Fixes

Tests

cargo test utils::update::tests

Result: 4 passed, 0 failed

Notes

  • The check_v == VERSION guard is unchanged — it prevents nagging from stale cache after the binary was upgraded since the last check.
  • Version::parse(...).unwrap() panic behavior is unchanged legacy code (file already has clippy::unwrap_used expect).

Fixes getsentry#3290

The is_outdated() check compared the fetched release version against
the running CLI version in the wrong direction, so the update nagger
never prompted when a newer release was available.

Add unit tests covering outdated, up-to-date, and dev-build scenarios.
@syf2211 syf2211 requested review from a team and szokeasaurusrex as code owners June 26, 2026 07:36

@szokeasaurusrex szokeasaurusrex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm in general, thanks for the contribution @syf2211

Comment thread src/utils/update.rs Outdated
@szokeasaurusrex szokeasaurusrex merged commit ae25f73 into getsentry:master Jun 26, 2026
26 checks passed
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.

Fix inverted update nagger version comparison

3 participants