Use lenient version parser to properly parse version provided by Mac

This commit is contained in:
Michal Horejsek
2021-02-01 13:03:57 +01:00
committed by Jakub Cuth
parent 72c01046e3
commit e055acb8eb
3 changed files with 11 additions and 2 deletions

View File

@ -20,6 +20,7 @@ package useragent
import (
"os/exec"
"runtime"
"strings"
"github.com/Masterminds/semver/v3"
)
@ -38,11 +39,11 @@ func getMacVersion() string {
return ""
}
return string(out)
return strings.TrimSpace(string(out))
}
func isVersionCatalinaOrNewer(version string) bool {
v, err := semver.StrictNewVersion(version)
v, err := semver.NewVersion(version)
if err != nil {
return false
}

View File

@ -34,6 +34,7 @@ func TestIsVersionCatalinaOrNewer(t *testing.T) {
{"10.15.0"}: true,
{"10.16.0"}: true,
{"11.0.0"}: true,
{"11.1"}: true,
}
for args, exp := range testData {

View File

@ -14,3 +14,10 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
### Fixed
* GODT-1011 Stable integration test deleting many messages using UID EXPUNGE.
* GODT-787 GODT-978 Fix IE and Bridge importing to sent not showing up in inbox (setting up flags properly).
* GODT-1006 Use correct macOS keychain name.
* GODT-1009 Set ContentID if present and not explicitly attachment.
* GODT-900 Remove \Deleted flag after re-importing the message (do not delete messages by moving to local folder and back).
* GODT-908 Do not unpause event loop if other mailbox is still fetching.
* Check deprecated status code first to better determine API error.
* GODT-1015 Use lenient version parser to properly parse version provided by Mac.