From 22b8c196a3c89fe937c892185d1ed03ea89cea4c Mon Sep 17 00:00:00 2001 From: Yacine Hmito <6893840+yacinehmito@users.noreply.github.com> Date: Wed, 3 Apr 2024 22:02:24 +0200 Subject: [PATCH] Make version takes precedence over platform The order of extension info is important because it dictates which extension is resolved when multiple revisions exist for the same name and same publisher. At the moment, extensions are first sorted by platform, then by version. This makes any platform-specific extension override a universal extension of the same name and publisher, even if the platform-specific extension is of a lower version. Sorting by version first ensures that extensions of the latest version end up last. Thus, if there is a universal extension of a higher version then a platform-specific extension, the universal extension will take precedence. However, if they are of the same version, the behavior is unchanged: the platform-specific extension will take precedence. --- haskell/app/Main.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haskell/app/Main.hs b/haskell/app/Main.hs index 793f987f..b0f792b9 100644 --- a/haskell/app/Main.hs +++ b/haskell/app/Main.hs @@ -238,7 +238,7 @@ runFetcher FetcherConfig{..} = do `catchAny` (\err -> runInIO $ logError (pack $ show err) >> pure []) let mkKey :: Publisher -> Name -> Platform -> Version -> LastUpdated -> (Publisher, Name, Platform, Version, LastUpdated) - mkKey publisher name platform version lastUpdated = (publisher, name, platform, version, lastUpdated) + mkKey publisher name platform version lastUpdated = (publisher, name, version, platform, lastUpdated) mkKeyInfo ExtensionInfo{..} = mkKey publisher name platform version lastUpdated mkKeyConfig ExtensionConfig{..} = mkKey publisher name platform version lastUpdated -- we load the cached info into a map for quicker access