Skip to content

Commit

Permalink
Increase version limit for package already reaching 1000. (#8058)
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Sep 17, 2024
1 parent 80c0c70 commit 9421634
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/lib/package/backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1139,9 +1139,11 @@ class PackageBackend {
package = Package.fromVersion(newVersion);
}

if (package!.versionCount >= maxVersionsPerPackage) {
final maxVersionCount = maxVersionsPerPackageOverrides[package!.name] ??
maxVersionsPerPackage;
if (package!.versionCount >= maxVersionCount) {
throw PackageRejectedException.maxVersionCountReached(
newVersion.package, maxVersionsPerPackage);
newVersion.package, maxVersionCount);
}

if (package!.deletedVersions != null &&
Expand Down
5 changes: 5 additions & 0 deletions app/lib/package/overrides.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,8 @@ bool isDartDevPublisher(String? publisherId) {
if (publisherId.endsWith('.google.com')) return true;
return false;
}

/// Overriding the default maximum number of the allowed package version counts.
const maxVersionsPerPackageOverrides = <String, int>{
'masamune': 1500, // last updated: 2024-09-16
};

0 comments on commit 9421634

Please sign in to comment.