From bd696be317ca50af6c65617fe5a981ddc4ab45fa Mon Sep 17 00:00:00 2001 From: Lukas Cenovsky Date: Tue, 8 Oct 2024 10:10:16 +0200 Subject: [PATCH] Handle case when both label and hash are missing --- api/script/utils/acquisition.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/script/utils/acquisition.ts b/api/script/utils/acquisition.ts index d7cae4c..bf8a7bc 100644 --- a/api/script/utils/acquisition.ts +++ b/api/script/utils/acquisition.ts @@ -59,8 +59,11 @@ function getUpdatePackage(packageHistory: Package[], request: UpdateCheckRequest // Note that older client plugin versions do not send the release label. If the // label is supplied, we use label comparison, since developers can release the // same update twice. Otherwise, we fall back to hash comparison. + // If request is missing both label and hash we take the latest package + // as we cannot determine which one the client is running foundRequestPackageInHistory = foundRequestPackageInHistory || + (!request.label && !request.packageHash) || (request.label && packageEntry.label === request.label) || (!request.label && packageEntry.packageHash === request.packageHash); if (packageEntry.isDisabled || (ignoreRolloutPackages && isUnfinishedRollout(packageEntry.rollout))) {