Skip to content

Commit

Permalink
fix: latest version warnings can be less eager
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Aug 21, 2024
1 parent 112aa68 commit 78387dc
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,20 @@ export const versionCheckerLogic = kea<versionCheckerLogicType>([
let level: 'warning' | 'info' | 'error' | undefined
if (diff.kind === 'major' || numVersionsBehind >= 20) {
level = 'error'
} else if ((diff.kind === 'minor' && diff.diff >= 5) || numVersionsBehind >= 10) {
} else if (diff.kind === 'minor' && diff.diff >= 15) {
level = 'warning'
} else if (diff.kind === 'minor' || numVersionsBehind >= 5) {
} else if ((diff.kind === 'minor' && diff.diff >= 10) || numVersionsBehind >= 10) {
level = 'info'
} else if (latestUsedVersion.extra) {
// if we have an extra (alpha/beta/rc/etc) version, we should always show a warning if they aren't on the latest
// if we have an extra (alpha/beta/rc/etc.) version, we should always show a warning if they aren't on the latest
level = 'warning'
} else {
// don't warn for a small number of patch versions behind
level = undefined
}

if (level) {
// we check if there is a "latest user version string" to avoid returning odd data in unexpected cases
if (level && !!versionToString(latestUsedVersion).trim().length) {
warning = {
latestUsedVersion: versionToString(latestUsedVersion),
latestAvailableVersion: versionToString(latestAvailableVersion),
Expand Down

0 comments on commit 78387dc

Please sign in to comment.