anchor.diff:          newVersion,
           entities.packageVersionInfo,
           ...entities.assets,
  -        emailEntityToStore,
  +        outgoingEmail,
           AuditLogRecord.packagePublished(
             uploader: agent,
             package: newVersion.package,
  
positive.code:     _logger.info('Invalidating cache for package ${newVersion.package}.');
      await purgePackageCache(newVersion.package);
  
      try {
        final emailFuture = emailBackend.trySendOutgoingEmail(emailEntityToStore);
  
        final latestVersionChanged = prevLatestStableVersion != null &&
            package!.latestVersion != prevLatestStableVersion;
        final latestPrereleaseVersionChanged =
            prevLatestPrereleaseVersion != null &&
                package!.latestPrereleaseVersion != prevLatestPrereleaseVersion;
        // Let's not block the upload response on these. In case of a timeout, the
        // underlying operations still go ahead, but the `Future.wait` call below
        // is not blocked on it.
        await Future.wait([
          emailFuture,
          // Trigger analysis and dartdoc generation. Dependent packages can be left
          // out here, because the dependency graph's background polling will pick up
          // the new upload, and will trigger analysis for the dependent packages.
          jobBackend.triggerAnalysis(newVersion.package, newVersion.version),
          jobBackend.triggerDartdoc(newVersion.package, newVersion.version),
          // Trigger a new doc generation for the previous latest stable version
          // in order to update the dartdoc entry and the canonical-urls.
          if (latestVersionChanged)
            jobBackend.triggerDartdoc(newVersion.package, prevLatestStableVersion,
                shouldProcess: true),
          // Reset the priority of the previous pre-release version.
          if (latestPrereleaseVersionChanged)
            jobBackend.triggerDartdoc(
                newVersion.package, prevLatestPrereleaseVersion,
                shouldProcess: false),
        ]).timeout(Duration(seconds: 10));
      } catch (e, st) {
        final v = newVersion.qualifiedVersionKey;
        _logger.severe('Error post-processing package upload $v', e, st);
      }
      _logger.info('Post-upload tasks completed in ${sw.elapsed}.');
      return pv;
    }
  
    Future<void> _checkUploadAuthorization(
  
negative.code:       authorizedUploaders:
            uploaderEmails.map((email) => EmailAddress(email)).toList(),
      );
      final outgoingEmail = emailBackend.prepareEntity(email);
  
      Package? package;
      String? prevLatestStableVersion;
  