anchor.diff:        final userId = _oauthToUser[oauthUserId];
         if (userId == null) {
           yield 'OAuthUserID "$oauthUserId" has no User.';
  -      }
  +        continue;
  +      }
  +      // make sure we have the latest userId -> oauthUserId mapping
  +      await _userExists(userId);
  +      // check mapping
         final pointer = _userToOauth[userId];
         if (pointer == null) {
           yield 'User "$userId" is mapped from OAuthUserID "$oauthUserId", but does not have it set.';
  
positive.code: 
      if (pv.uploader == null) {
        yield 'PackageVersion "${pv.qualifiedVersionKey}" has no uploader.';
      }
      if (!_userToOauth.containsKey(pv.uploader)) {
        yield 'PackageVersion "${pv.qualifiedVersionKey}" has uploader without User: "${pv.uploader}".';
      }
      if (_invalidUsers.contains(pv.uploader)) {
        yield 'PackageVersion "${pv.qualifiedVersionKey}" has invalid uploader: User "${pv.uploader}".';
      }
      if (pv.isRetracted && pv.retracted == null) {
        yield 'PackageVersion "${pv.qualifiedVersionKey}" is retracted, but `retracted` property is null.';
  
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 {
  