@fluidframework/map 2.0.0-internal.7.4.2 → 2.0.0-internal.7.4.4

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.
@@ -476,10 +476,7 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
476
476
  // guaranteed during the serialization process. As a result, it is only essential to utilize the
477
477
  // "fake" client sequence number to signify the loading order, and there is no need to retain
478
478
  // the actual client sequence number at this point.
479
- if (createInfo !== undefined && createInfo.csn > -1) {
480
- // If csn is -1, then initialize it with 0, otherwise we will never process ops for this
481
- // sub directory. This could be done at serialization time too, but we need to maintain
482
- // back compat too and also we will actually know the state when it was serialized.
479
+ if (createInfo !== undefined && createInfo.csn > 0) {
483
480
  if (!tempSeqNums.has(createInfo.csn)) {
484
481
  tempSeqNums.set(createInfo.csn, 0);
485
482
  }
@@ -488,6 +485,13 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
488
485
  tempSeqNums.set(createInfo.csn, ++fakeClientSeq);
489
486
  }
490
487
  else {
488
+ /**
489
+ * 1. If csn is -1, then initialize it with 0, otherwise we will never process ops for this
490
+ * sub directory. This could be done at serialization time too, but we need to maintain
491
+ * back compat too and also we will actually know the state when it was serialized.
492
+ * 2. We need to make the csn = -1 and csn = 0 share the same counter, there are cases
493
+ * where both -1 and 0 coexist within a single document.
494
+ */
491
495
  seqData = {
492
496
  seq: 0,
493
497
  clientSeq: ++currentSubDir.localCreationSeq,