From 1ec329b1a9e755c990ba3ef4bc38fab5c1737a43 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Mon, 23 Oct 2023 16:14:39 -0300 Subject: [PATCH] review --- .../supportedVersionsToken/supportedVersionsToken.ts | 7 +++---- .../server/functions/buildVersionUpdateMessage.ts | 7 ++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts index 861b46e56acc..f4c662362f5c 100644 --- a/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts +++ b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts @@ -84,10 +84,9 @@ const cacheValueInSettings = ( ); }; -const releaseEndpoint = - process.env.OVERWRITE_INTERNAL_RELEASE_URL && process.env.OVERWRITE_INTERNAL_RELEASE_URL.trim().length > 0 - ? process.env.OVERWRITE_INTERNAL_RELEASE_URL - : 'https://releases.rocket.chat/v2/server/supportedVersions'; +const releaseEndpoint = process.env.OVERWRITE_INTERNAL_RELEASE_URL?.trim() + ? process.env.OVERWRITE_INTERNAL_RELEASE_URL.trim() + : 'https://releases.rocket.chat/v2/server/supportedVersions'; const getSupportedVersionsFromCloud = async () => { if (process.env.CLOUD_SUPPORTED_VERSIONS_TOKEN) { diff --git a/apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts b/apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts index a4b4121e415f..8d159213d4e3 100644 --- a/apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts +++ b/apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts @@ -15,10 +15,11 @@ export const buildVersionUpdateMessage = async ( ) => { const lastCheckedVersion = settings.get('Update_LatestAvailableVersion'); + if (!lastCheckedVersion) { + return; + } + for await (const version of versions) { - if (!lastCheckedVersion) { - break; - } if (semver.lte(version.version, lastCheckedVersion)) { continue; }