diff --git a/agent/src/Lib/External/Registry.hs b/agent/src/Lib/External/Registry.hs index c8d423b35..14713bfcf 100644 --- a/agent/src/Lib/External/Registry.hs +++ b/agent/src/Lib/External/Registry.hs @@ -36,6 +36,7 @@ import Lib.SystemPaths import Lib.Types.Core import Lib.Types.Emver import Lib.Types.ServerApp +import Data.Time.ISO8601 ( parseISO8601 ) newtype AppManifestRes = AppManifestRes { storeApps :: [StoreApp] } deriving (Eq, Show) @@ -135,7 +136,7 @@ parseAppData = do storeAppVersions <- ad .: "version-info" >>= \case [] -> fail "No Valid Version Info" (x : xs) -> pure $ x :| xs - storeAppTimestamp <- ad .: "timestamp" + storeAppTimestamp <- ad .: "timestamp" >>= maybe (fail "Invalid ISO8601 Timestamp") pure . parseISO8601 pure StoreApp { .. } getAppVersionForSpec :: (Has RegistryUrl sig m, Has (Error S9Error) sig m, MonadIO m) diff --git a/agent/src/Lib/Types/ServerApp.hs b/agent/src/Lib/Types/ServerApp.hs index 1ffa0aebb..9db1c67c9 100644 --- a/agent/src/Lib/Types/ServerApp.hs +++ b/agent/src/Lib/Types/ServerApp.hs @@ -36,7 +36,7 @@ instance FromJSON StoreAppVersionInfo where parseJSON = withObject "Store App Version Info" $ \o -> do storeAppVersionInfoVersion <- o .: "version" storeAppVersionInfoReleaseNotes <- o .: "release-notes" - storeAppVersionInfoInstallAlert <- o .: "install-alert" + storeAppVersionInfoInstallAlert <- o .:? "install-alert" pure StoreAppVersionInfo { .. } instance ToJSON StoreAppVersionInfo where toJSON StoreAppVersionInfo {..} =