@@ -40,6 +40,11 @@ class IntegrityChecker {
4040 final DatastoreDB _db;
4141 final int _concurrency;
4242
43+ static const _knownUnmappedFields = {
44+ 'Package.isWithheld' ,
45+ 'Package.withheldReason' ,
46+ };
47+ final _unmappedFields = < String > {};
4348 final _userToOauth = < String , String ? > {};
4449 final _oauthToUser = < String , String > {};
4550 final _deletedUsers = < String > {};
@@ -93,7 +98,13 @@ class IntegrityChecker {
9398 yield * _checkAuditLogs ();
9499 yield * _checkModerationCases ();
95100 yield * _reportPubspecVersionIssues ();
96- // TODO: report unmapped properties
101+
102+ if (_unmappedFields.isNotEmpty) {
103+ for (final field in _unmappedFields) {
104+ if (_knownUnmappedFields.contains (field)) continue ;
105+ yield 'Unmapped field found: $field .' ;
106+ }
107+ }
97108 } finally {
98109 _httpClient.close ();
99110 }
@@ -448,6 +459,7 @@ class IntegrityChecker {
448459 }
449460
450461 await for (final pvi in pviQuery.run ()) {
462+ _updateUnmappedFields (pvi);
451463 final key = pvi.qualifiedVersionKey;
452464 pviKeys.add (key);
453465 yield * checkPackageVersionKey ('PackageVersionInfo' , key);
@@ -475,6 +487,7 @@ class IntegrityChecker {
475487 ..filter ('package =' , p.name);
476488 final foundAssetIds = < String ? > {};
477489 await for (final pva in pvaQuery.run ()) {
490+ _updateUnmappedFields (pva);
478491 final key = pva.qualifiedVersionKey;
479492 if (pva.id !=
480493 Uri (pathSegments: [pva.package! , pva.version! , pva.kind! ]).path) {
@@ -907,13 +920,23 @@ class IntegrityChecker {
907920 }
908921 }
909922
923+ void _updateUnmappedFields (Model m) {
924+ if (m is ExpandoModel && m.additionalProperties.isNotEmpty) {
925+ for (final key in m.additionalProperties.keys) {
926+ final field = [m.runtimeType.toString (), key].join ('.' );
927+ _unmappedFields.add (field);
928+ }
929+ }
930+ }
931+
910932 Stream <String > _queryWithPool <R extends Model >(
911933 Stream <String > Function (R model) fn) async * {
912934 final query = _db.query <R >();
913935 final pool = Pool (_concurrency);
914936 final futures = < Future <List <String >>> [];
915937 try {
916938 await for (final m in query.run ()) {
939+ _updateUnmappedFields (m);
917940 final f = pool.withResource (() => fn (m).toList ());
918941 futures.add (f);
919942 }
0 commit comments