Skip to content

Commit 383d78f

Browse files
committed
Rename to _allowedUnmappedFields + documentation.
1 parent 9d9ae4a commit 383d78f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

app/lib/shared/integrity.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,19 @@ import 'utils.dart' show canonicalizeVersion, ByteArrayEqualsExt;
3535
final _logger = Logger('integrity.check');
3636
final _random = math.Random.secure();
3737

38+
/// The unmapped/unused fields that we expect to be present on some entities.
39+
/// The presence of such fields won't be reported as integrity issue, only
40+
/// the absent ones will be reported.
41+
const _allowedUnmappedFields = {
42+
'Package.isWithheld',
43+
'Package.withheldReason',
44+
};
45+
3846
/// Checks the integrity of the datastore.
3947
class IntegrityChecker {
4048
final DatastoreDB _db;
4149
final int _concurrency;
4250

43-
static const _knownUnmappedFields = {
44-
'Package.isWithheld',
45-
'Package.withheldReason',
46-
};
4751
final _unmappedFields = <String>{};
4852
final _userToOauth = <String, String?>{};
4953
final _oauthToUser = <String, String>{};
@@ -101,7 +105,7 @@ class IntegrityChecker {
101105

102106
if (_unmappedFields.isNotEmpty) {
103107
for (final field in _unmappedFields) {
104-
if (_knownUnmappedFields.contains(field)) continue;
108+
if (_allowedUnmappedFields.contains(field)) continue;
105109
yield 'Unmapped field found: $field.';
106110
}
107111
}

0 commit comments

Comments
 (0)