Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 4.9] OF-2941: Improve Version comparison that involve SNAPSHOTs #2648

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Jan 4, 2025

Description

Backport of #2643 to 4.9.

For certain versions of plugins, Openfire incorrectly identifies that an update is available.

When Openfire has installed `10.1.7.3-SNAPSHOT` it incorrectly identifies that version `10.1.7.2` is an update.

This seems to be caused by Openfire’s abuse of the 4th numeric value in a version. It was originally intended to be a classifier for the status (eg: ‘the second beta release’). When that 4th value is used as part of a four-digit version, things do not quite compare as expected.

To illustrate, compare these two scenarios. The numbers 3 and 2 are all stored in the same field, which gets interpreted differently.

- `10.1.7 beta 3` is older than `10.1.7 release 2`

- `10.1.7.3-SNAPSHOT` is expected to be newer than `10.1.7.2` (release).

Prior to this commit, Openfire did not flag that `10.1.7.3-SNAPSHOT` is newer than `10.1.7.2`, which was causing confusion.

In this commit, _only_ the `SNAPSHOT` release status is now compared differently (as if the 4th value is part of the version string).

(cherry picked from commit 72b67cb)
@guusdk
Copy link
Member

guusdk commented Jan 6, 2025

@akrherz any particular reason that you didn't merge this yes?

@guusdk guusdk merged commit dea629e into 4.9 Jan 6, 2025
18 checks passed
@akrherz akrherz deleted the backport-2643-to-4.9 branch January 6, 2025 14:07
@akrherz
Copy link
Member

akrherz commented Jan 6, 2025

@akrherz any particular reason that you didn't merge this yes?

I was just awaiting your feedback as I wasn't sure about it going to this branch.

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