diff --git a/src/Service/PackageSynchronizer/ComposerPackageSynchronizer.php b/src/Service/PackageSynchronizer/ComposerPackageSynchronizer.php index 2c2c8855..d07de224 100644 --- a/src/Service/PackageSynchronizer/ComposerPackageSynchronizer.php +++ b/src/Service/PackageSynchronizer/ComposerPackageSynchronizer.php @@ -115,7 +115,11 @@ public function synchronize(Package $package): void $version['distType'] ); - if ($package->keepLastReleases() > 0 && count($encounteredVersions) >= $package->keepLastReleases()) { + if ( + $latest->getVersion() !== $version['version'] + && $package->keepLastReleases() > 0 + && count($encounteredVersions) >= $package->keepLastReleases() + ) { $this->distStorage->remove($dist); $package->removeVersion(new Version( Uuid::uuid4(), diff --git a/src/Service/Security/PackageScanner/SensioLabsPackageScanner.php b/src/Service/Security/PackageScanner/SensioLabsPackageScanner.php index b890ce96..03d50322 100644 --- a/src/Service/Security/PackageScanner/SensioLabsPackageScanner.php +++ b/src/Service/Security/PackageScanner/SensioLabsPackageScanner.php @@ -123,7 +123,7 @@ private function findDistribution(Package $package): string ); return $filename->getOrElseThrow( - new \RuntimeException('Distribution file not found') + new \RuntimeException("Distribution file for version $packageVersion not found") ); } }