@colyseus/schema 3.0.0-alpha.45 → 3.0.0-alpha.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -657,7 +657,7 @@ class TypeContext {
657
657
  }
658
658
  // add classes inherited from this base class
659
659
  TypeContext.inheritedTypes.get(klass)?.forEach((child) => {
660
- this.discoverTypes(child, klass, parentIndex, parentHasViewTag);
660
+ this.discoverTypes(child, parentType, parentIndex, parentHasViewTag);
661
661
  });
662
662
  // add parent classes
663
663
  let parent = klass;
@@ -1337,7 +1337,10 @@ class ChangeTree {
1337
1337
  if (!parent) {
1338
1338
  return;
1339
1339
  }
1340
+ //
1340
1341
  // ArraySchema | MapSchema - get the child type
1342
+ // (if refType is typeof string, the parentFiltered[key] below will always be invalid)
1343
+ //
1341
1344
  const refType = Metadata.isValidInstance(this.ref)
1342
1345
  ? this.ref.constructor
1343
1346
  : this.ref[$childType];
@@ -1352,7 +1355,8 @@ class ChangeTree {
1352
1355
  key += `-${this.root.types.schemas.get(parentConstructor)}`;
1353
1356
  }
1354
1357
  key += `-${parentIndex}`;
1355
- this.isFiltered = this.root.types.parentFiltered[key];
1358
+ this.isFiltered = parent[$changes].isFiltered // in case parent is already filtered
1359
+ || this.root.types.parentFiltered[key];
1356
1360
  // const parentMetadata = parentConstructor?.[Symbol.metadata];
1357
1361
  // this.isFiltered = parentMetadata?.[$viewFieldIndexes]?.includes(parentIndex) || this.root.types.parentFiltered[key];
1358
1362
  //