Skip to content

Commit

Permalink
Handle case when both label and hash are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
lucen-ms committed Oct 8, 2024
1 parent bc04919 commit bd696be
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/script/utils/acquisition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down

0 comments on commit bd696be

Please sign in to comment.