anchor.diff:      if (p.likes < 0) {
         yield 'Package "${p.name}" has a `likes` property which is not a non-negative integer.';
       }
  -    for (String? userId in p.uploaders!) {
  -      if (!_userToOauth.containsKey(userId)) {
  -        yield 'Package "${p.name}" has uploader without User: "$userId".';
  -      }
  -      if (_invalidUsers.contains(userId)) {
  -        yield 'Package "${p.name}" has invalid uploader: "$userId".';
  -      }
  +    for (final userId in p.uploaders!) {
  +      yield* _checkUserValid(
  +        userId,
  +        entityType: 'Package',
  +        entityId: p.name,
  +      );
       }
       if (p.deletedVersions != null) {
         // make sure we store valid versions here
  
positive.code:       if (!_publishers.contains(pm.publisherId)) {
          yield 'PublisherMember "${pm.userId}" references a non-existing `publisherId`: "${pm.publisherId}".';
        }
        if (_deletedUsers.contains(pm.userId)) {
          yield 'PublisherMember "${pm.publisherId}" / "${pm.userId}" references a deleted User.';
        }
        if (!_userToOauth.containsKey(pm.userId)) {
          yield 'PublisherMember "${pm.publisherId}" / "${pm.userId}" references a non-existing User.';
        }
      }
    }
  
negative.code:         yield 'AuditLogRecord "${r.id}" has missing package "$p" in package version "$pv".';
        }
      }
    }
  
    Stream<String> _checkUserValid(
      String userId, {
      required String entityType,
      String? entityId,
  
      /// Set true for entries where we retain the record indefintely,
      /// even if the [User] has been deleted or invalidated.
      bool isRetainedRecord = false,
    }) async* {
      final label =
          entityId == null ? '$entityType entity' : '$entityType "$entityId"';
      if (!(await _userExists(userId))) {
        yield '$label references a nonexisting User: "$userId".';
      }
      if (!isRetainedRecord && _deletedUsers.contains(userId)) {
        yield '$label references a deleted User "$userId".';
      }
      if (_invalidUsers.contains(userId)) {
        yield '$label references an invalid User: "$userId".';
      }
    }
  
    Future<bool> _userExists(String userId) async {
      if (_userToOauth.containsKey(userId)) {
        return true;
      }
      final user =
          await _db.lookupOrNull<User>(_db.emptyKey.append(User, id: userId));
      if (user == null) {
        return false;
      }
      _userToOauth[user.oauthUserId!] = user.userId;
      return true;
    }
  
    Future<bool> _packageExists(String packageName) async {
  