@colyseus/schema 3.0.45 → 3.0.47

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.
@@ -1426,7 +1426,9 @@ class ChangeTree {
1426
1426
  */
1427
1427
  addParent(parent, index) {
1428
1428
  // Check if this parent already exists in the chain
1429
- if (this.hasParent((p, i) => p[$changes] === parent[$changes] && i === index)) {
1429
+ if (this.hasParent((p, _) => p[$changes] === parent[$changes])) {
1430
+ // if (this.hasParent((p, i) => p[$changes] === parent[$changes] && i === index)) {
1431
+ this.parentChain.index = index;
1430
1432
  return;
1431
1433
  }
1432
1434
  this.parentChain = {
@@ -3924,7 +3926,6 @@ class Root {
3924
3926
  }
3925
3927
  remove(changeTree) {
3926
3928
  const refCount = (this.refCount[changeTree.refId]) - 1;
3927
- // console.log("REMOVE", { refId: changeTree.refId, refCount });
3928
3929
  if (refCount <= 0) {
3929
3930
  //
3930
3931
  // Only remove "root" reference if it's the last reference
@@ -5161,7 +5162,7 @@ class StateView {
5161
5162
  if (tag === DEFAULT_VIEW_TAG) {
5162
5163
  // parent is collection (Map/Array)
5163
5164
  const parent = changeTree.parent;
5164
- if (!Metadata.isValidInstance(parent) && changeTree.isFiltered) {
5165
+ if (parent && !Metadata.isValidInstance(parent) && changeTree.isFiltered) {
5165
5166
  const parentChangeTree = parent[$changes];
5166
5167
  let changes = this.changes.get(parentChangeTree.refId);
5167
5168
  if (changes === undefined) {