Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions app/lib/package/backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1073,13 +1073,12 @@ class PackageBackend {
}) async {
final sw = Stopwatch()..start();
final newVersion = entities.packageVersion;
final currentDartSdk = await getCachedDartSdkVersion(
lastKnownStable: toolStableDartSdkVersion);
final currentFlutterSdk = await getCachedFlutterSdkVersion(
lastKnownStable: toolStableFlutterSdkVersion);
final [currentDartSdk, currentFlutterSdk] = await Future.wait([
getCachedDartSdkVersion(lastKnownStable: toolStableDartSdkVersion),
getCachedFlutterSdkVersion(lastKnownStable: toolStableFlutterSdkVersion),
]);
final existingPackage = await lookupPackage(newVersion.package);
final isNew = existingPackage == null;

// check authorizations before the transaction
await _requireUploadAuthorization(
agent, existingPackage, newVersion.version!);
Expand All @@ -1102,14 +1101,12 @@ class PackageBackend {
throw AssertionError(
'Package "${newVersion.package}" has no admin email to notify.');
}

// check rate limits before the transaction
await verifyPackageUploadRateLimit(
agent: agent,
package: newVersion.package,
isNew: isNew,
);

final email = createPackageUploadedEmail(
packageName: newVersion.package,
packageVersion: newVersion.version!,
Expand All @@ -1118,7 +1115,6 @@ class PackageBackend {
uploaderEmails.map((email) => EmailAddress(email)).toList(),
);
final outgoingEmail = emailBackend.prepareEntity(email);

Package? package;
final existingVersions = await db
.query<PackageVersion>(ancestorKey: newVersion.packageKey!)
Expand Down
Loading