@fluidframework/sequence 2.0.0-rc.1.0.4 → 2.0.0-rc.2.0.0
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.
- package/{.eslintrc.js → .eslintrc.cjs} +4 -1
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor.json +1 -1
- package/api-report/sequence.api.md +15 -27
- package/dist/defaultMap.d.ts +10 -16
- package/dist/defaultMap.d.ts.map +1 -1
- package/dist/defaultMap.js +73 -70
- package/dist/defaultMap.js.map +1 -1
- package/dist/defaultMapInterfaces.d.ts +1 -8
- package/dist/defaultMapInterfaces.d.ts.map +1 -1
- package/dist/defaultMapInterfaces.js.map +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -42
- package/dist/index.js.map +1 -1
- package/dist/intervalCollection.d.ts +21 -15
- package/dist/intervalCollection.d.ts.map +1 -1
- package/dist/intervalCollection.js +59 -110
- package/dist/intervalCollection.js.map +1 -1
- package/dist/intervalIndex/endpointInRangeIndex.d.ts +3 -3
- package/dist/intervalIndex/endpointInRangeIndex.d.ts.map +1 -1
- package/dist/intervalIndex/endpointInRangeIndex.js +8 -8
- package/dist/intervalIndex/endpointInRangeIndex.js.map +1 -1
- package/dist/intervalIndex/endpointIndex.d.ts +3 -3
- package/dist/intervalIndex/endpointIndex.d.ts.map +1 -1
- package/dist/intervalIndex/endpointIndex.js +4 -4
- package/dist/intervalIndex/endpointIndex.js.map +1 -1
- package/dist/intervalIndex/idIntervalIndex.d.ts +2 -2
- package/dist/intervalIndex/idIntervalIndex.d.ts.map +1 -1
- package/dist/intervalIndex/idIntervalIndex.js +2 -2
- package/dist/intervalIndex/idIntervalIndex.js.map +1 -1
- package/dist/intervalIndex/index.d.ts +8 -8
- package/dist/intervalIndex/index.d.ts.map +1 -1
- package/dist/intervalIndex/index.js +16 -16
- package/dist/intervalIndex/index.js.map +1 -1
- package/dist/intervalIndex/intervalIndex.d.ts +1 -1
- package/dist/intervalIndex/intervalIndex.d.ts.map +1 -1
- package/dist/intervalIndex/intervalIndex.js.map +1 -1
- package/dist/intervalIndex/overlappingIntervalsIndex.d.ts +7 -10
- package/dist/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
- package/dist/intervalIndex/overlappingIntervalsIndex.js +12 -13
- package/dist/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
- package/dist/intervalIndex/overlappingSequenceIntervalsIndex.d.ts +2 -2
- package/dist/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +1 -1
- package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js +7 -7
- package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js.map +1 -1
- package/dist/intervalIndex/sequenceIntervalIndexes.d.ts +2 -2
- package/dist/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -1
- package/dist/intervalIndex/sequenceIntervalIndexes.js.map +1 -1
- package/dist/intervalIndex/startpointInRangeIndex.d.ts +3 -3
- package/dist/intervalIndex/startpointInRangeIndex.d.ts.map +1 -1
- package/dist/intervalIndex/startpointInRangeIndex.js +8 -8
- package/dist/intervalIndex/startpointInRangeIndex.js.map +1 -1
- package/dist/intervalTree.d.ts +1 -1
- package/dist/intervalTree.d.ts.map +1 -1
- package/dist/intervalTree.js.map +1 -1
- package/dist/intervals/index.d.ts +3 -3
- package/dist/intervals/index.d.ts.map +1 -1
- package/dist/intervals/index.js +16 -16
- package/dist/intervals/index.js.map +1 -1
- package/dist/intervals/interval.d.ts +2 -2
- package/dist/intervals/interval.d.ts.map +1 -1
- package/dist/intervals/interval.js +2 -2
- package/dist/intervals/interval.js.map +1 -1
- package/dist/intervals/intervalUtils.d.ts +3 -3
- package/dist/intervals/intervalUtils.d.ts.map +1 -1
- package/dist/intervals/intervalUtils.js +1 -1
- package/dist/intervals/intervalUtils.js.map +1 -1
- package/dist/intervals/sequenceInterval.d.ts +2 -2
- package/dist/intervals/sequenceInterval.d.ts.map +1 -1
- package/dist/intervals/sequenceInterval.js +22 -23
- package/dist/intervals/sequenceInterval.js.map +1 -1
- package/dist/localValues.d.ts +2 -2
- package/dist/localValues.d.ts.map +1 -1
- package/dist/localValues.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/revertibles.d.ts +12 -12
- package/dist/revertibles.d.ts.map +1 -1
- package/dist/revertibles.js +26 -26
- package/dist/revertibles.js.map +1 -1
- package/dist/sequence-alpha.d.ts +172 -13
- package/dist/sequence-beta.d.ts +2 -0
- package/dist/sequence-public.d.ts +2 -0
- package/dist/sequence-untrimmed.d.ts +73 -14
- package/dist/sequence.d.ts +48 -5
- package/dist/sequence.d.ts.map +1 -1
- package/dist/sequence.js +103 -29
- package/dist/sequence.js.map +1 -1
- package/dist/sequenceFactory.d.ts +4 -1
- package/dist/sequenceFactory.d.ts.map +1 -1
- package/dist/sequenceFactory.js +8 -5
- package/dist/sequenceFactory.js.map +1 -1
- package/dist/sharedIntervalCollection.d.ts +2 -2
- package/dist/sharedIntervalCollection.d.ts.map +1 -1
- package/dist/sharedIntervalCollection.js +5 -5
- package/dist/sharedIntervalCollection.js.map +1 -1
- package/dist/sharedSequence.d.ts +1 -1
- package/dist/sharedSequence.d.ts.map +1 -1
- package/dist/sharedSequence.js +2 -2
- package/dist/sharedSequence.js.map +1 -1
- package/dist/sharedString.d.ts +2 -2
- package/dist/sharedString.d.ts.map +1 -1
- package/dist/sharedString.js +6 -6
- package/dist/sharedString.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/{defaultMap.d.mts → defaultMap.d.ts} +11 -17
- package/lib/defaultMap.d.ts.map +1 -0
- package/lib/{defaultMap.mjs → defaultMap.js} +72 -69
- package/lib/defaultMap.js.map +1 -0
- package/lib/{defaultMapInterfaces.d.mts → defaultMapInterfaces.d.ts} +2 -9
- package/lib/defaultMapInterfaces.d.ts.map +1 -0
- package/lib/{defaultMapInterfaces.mjs → defaultMapInterfaces.js} +1 -1
- package/lib/defaultMapInterfaces.js.map +1 -0
- package/lib/{index.d.mts → index.d.ts} +24 -12
- package/lib/index.d.ts.map +1 -0
- package/lib/{index.mjs → index.js} +11 -11
- package/lib/index.js.map +1 -0
- package/lib/{intervalCollection.d.mts → intervalCollection.d.ts} +22 -16
- package/lib/intervalCollection.d.ts.map +1 -0
- package/lib/{intervalCollection.mjs → intervalCollection.js} +23 -74
- package/lib/intervalCollection.js.map +1 -0
- package/lib/intervalIndex/{endpointInRangeIndex.d.mts → endpointInRangeIndex.d.ts} +4 -4
- package/lib/intervalIndex/endpointInRangeIndex.d.ts.map +1 -0
- package/lib/intervalIndex/{endpointInRangeIndex.mjs → endpointInRangeIndex.js} +3 -3
- package/lib/intervalIndex/endpointInRangeIndex.js.map +1 -0
- package/lib/intervalIndex/{endpointIndex.d.mts → endpointIndex.d.ts} +4 -4
- package/lib/intervalIndex/endpointIndex.d.ts.map +1 -0
- package/lib/intervalIndex/{endpointIndex.mjs → endpointIndex.js} +2 -2
- package/lib/intervalIndex/endpointIndex.js.map +1 -0
- package/lib/intervalIndex/{idIntervalIndex.d.mts → idIntervalIndex.d.ts} +3 -3
- package/lib/intervalIndex/idIntervalIndex.d.ts.map +1 -0
- package/lib/intervalIndex/{idIntervalIndex.mjs → idIntervalIndex.js} +2 -2
- package/lib/intervalIndex/idIntervalIndex.js.map +1 -0
- package/lib/intervalIndex/{index.d.mts → index.d.ts} +9 -9
- package/lib/intervalIndex/index.d.ts.map +1 -0
- package/lib/intervalIndex/{index.mjs → index.js} +7 -7
- package/lib/intervalIndex/index.js.map +1 -0
- package/lib/intervalIndex/{intervalIndex.d.mts → intervalIndex.d.ts} +2 -2
- package/lib/intervalIndex/intervalIndex.d.ts.map +1 -0
- package/lib/intervalIndex/{intervalIndex.mjs → intervalIndex.js} +1 -1
- package/lib/intervalIndex/intervalIndex.js.map +1 -0
- package/lib/intervalIndex/{intervalIndexUtils.d.mts → intervalIndexUtils.d.ts} +1 -1
- package/lib/intervalIndex/intervalIndexUtils.d.ts.map +1 -0
- package/lib/intervalIndex/{intervalIndexUtils.mjs → intervalIndexUtils.js} +1 -1
- package/lib/intervalIndex/intervalIndexUtils.js.map +1 -0
- package/lib/intervalIndex/{overlappingIntervalsIndex.d.mts → overlappingIntervalsIndex.d.ts} +8 -11
- package/lib/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -0
- package/lib/intervalIndex/{overlappingIntervalsIndex.mjs → overlappingIntervalsIndex.js} +8 -9
- package/lib/intervalIndex/overlappingIntervalsIndex.js.map +1 -0
- package/lib/intervalIndex/{overlappingSequenceIntervalsIndex.d.mts → overlappingSequenceIntervalsIndex.d.ts} +3 -3
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +1 -0
- package/lib/intervalIndex/{overlappingSequenceIntervalsIndex.mjs → overlappingSequenceIntervalsIndex.js} +3 -3
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js.map +1 -0
- package/lib/intervalIndex/{sequenceIntervalIndexes.d.mts → sequenceIntervalIndexes.d.ts} +3 -3
- package/lib/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -0
- package/lib/intervalIndex/{sequenceIntervalIndexes.mjs → sequenceIntervalIndexes.js} +1 -1
- package/lib/intervalIndex/sequenceIntervalIndexes.js.map +1 -0
- package/lib/intervalIndex/{startpointInRangeIndex.d.mts → startpointInRangeIndex.d.ts} +4 -4
- package/lib/intervalIndex/startpointInRangeIndex.d.ts.map +1 -0
- package/lib/intervalIndex/{startpointInRangeIndex.mjs → startpointInRangeIndex.js} +3 -3
- package/lib/intervalIndex/startpointInRangeIndex.js.map +1 -0
- package/lib/{intervalTree.d.mts → intervalTree.d.ts} +2 -2
- package/lib/intervalTree.d.ts.map +1 -0
- package/lib/{intervalTree.mjs → intervalTree.js} +1 -1
- package/lib/intervalTree.js.map +1 -0
- package/lib/intervals/{index.d.mts → index.d.ts} +4 -4
- package/lib/intervals/index.d.ts.map +1 -0
- package/lib/intervals/{index.mjs → index.js} +4 -4
- package/lib/intervals/index.js.map +1 -0
- package/lib/intervals/{interval.d.mts → interval.d.ts} +3 -3
- package/lib/intervals/{interval.d.mts.map → interval.d.ts.map} +1 -1
- package/lib/intervals/{interval.mjs → interval.js} +2 -2
- package/lib/intervals/interval.js.map +1 -0
- package/lib/intervals/{intervalUtils.d.mts → intervalUtils.d.ts} +4 -4
- package/lib/intervals/intervalUtils.d.ts.map +1 -0
- package/lib/intervals/{intervalUtils.mjs → intervalUtils.js} +3 -2
- package/lib/intervals/intervalUtils.js.map +1 -0
- package/lib/intervals/{sequenceInterval.d.mts → sequenceInterval.d.ts} +3 -3
- package/lib/intervals/sequenceInterval.d.ts.map +1 -0
- package/lib/intervals/{sequenceInterval.mjs → sequenceInterval.js} +5 -4
- package/lib/intervals/{sequenceInterval.mjs.map → sequenceInterval.js.map} +1 -1
- package/lib/{localValues.d.mts → localValues.d.ts} +3 -3
- package/lib/{localValues.d.mts.map → localValues.d.ts.map} +1 -1
- package/lib/{localValues.mjs → localValues.js} +1 -1
- package/lib/localValues.js.map +1 -0
- package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
- package/lib/packageVersion.js.map +1 -0
- package/lib/{revertibles.d.mts → revertibles.d.ts} +13 -13
- package/lib/revertibles.d.ts.map +1 -0
- package/lib/{revertibles.mjs → revertibles.js} +11 -10
- package/lib/revertibles.js.map +1 -0
- package/lib/{sequence-alpha.d.mts → sequence-alpha.d.ts} +185 -13
- package/lib/{sequence-public.d.mts → sequence-beta.d.ts} +15 -0
- package/lib/{sequence-beta.d.mts → sequence-public.d.ts} +15 -0
- package/lib/{sequence-untrimmed.d.mts → sequence-untrimmed.d.ts} +86 -14
- package/lib/{sequence.d.mts → sequence.d.ts} +49 -6
- package/lib/sequence.d.ts.map +1 -0
- package/lib/{sequence.mjs → sequence.js} +100 -29
- package/lib/sequence.js.map +1 -0
- package/lib/{sequenceDeltaEvent.d.mts → sequenceDeltaEvent.d.ts} +1 -1
- package/lib/sequenceDeltaEvent.d.ts.map +1 -0
- package/lib/{sequenceDeltaEvent.mjs → sequenceDeltaEvent.js} +1 -1
- package/lib/sequenceDeltaEvent.js.map +1 -0
- package/lib/{sequenceFactory.d.mts → sequenceFactory.d.ts} +5 -2
- package/lib/sequenceFactory.d.ts.map +1 -0
- package/lib/{sequenceFactory.mjs → sequenceFactory.js} +6 -3
- package/lib/sequenceFactory.js.map +1 -0
- package/lib/{sharedIntervalCollection.d.mts → sharedIntervalCollection.d.ts} +3 -3
- package/lib/sharedIntervalCollection.d.ts.map +1 -0
- package/lib/{sharedIntervalCollection.mjs → sharedIntervalCollection.js} +4 -4
- package/lib/sharedIntervalCollection.js.map +1 -0
- package/lib/{sharedSequence.d.mts → sharedSequence.d.ts} +2 -2
- package/lib/sharedSequence.d.ts.map +1 -0
- package/lib/{sharedSequence.mjs → sharedSequence.js} +2 -2
- package/lib/sharedSequence.js.map +1 -0
- package/lib/{sharedString.d.mts → sharedString.d.ts} +3 -3
- package/lib/sharedString.d.ts.map +1 -0
- package/lib/{sharedString.mjs → sharedString.js} +3 -3
- package/lib/sharedString.js.map +1 -0
- package/lib/test/collections.intervalTree.js +73 -0
- package/lib/test/collections.intervalTree.js.map +1 -0
- package/lib/test/createSnapshotFiles.js +15 -0
- package/lib/test/createSnapshotFiles.js.map +1 -0
- package/lib/test/dirname.cjs +16 -0
- package/lib/test/dirname.cjs.map +1 -0
- package/lib/test/endpointInRangeIndex.spec.js +182 -0
- package/lib/test/endpointInRangeIndex.spec.js.map +1 -0
- package/lib/test/fuzz/fuzzUtils.js +250 -0
- package/lib/test/fuzz/fuzzUtils.js.map +1 -0
- package/lib/test/fuzz/intervalCollection.fuzz.spec.js +200 -0
- package/lib/test/fuzz/intervalCollection.fuzz.spec.js.map +1 -0
- package/lib/test/fuzz/intervalRevertibles.fuzz.spec.js +129 -0
- package/lib/test/fuzz/intervalRevertibles.fuzz.spec.js.map +1 -0
- package/lib/test/fuzz/sharedString.fuzz.spec.js +91 -0
- package/lib/test/fuzz/sharedString.fuzz.spec.js.map +1 -0
- package/lib/test/generateSharedStrings.js +138 -0
- package/lib/test/generateSharedStrings.js.map +1 -0
- package/lib/test/intervalCollection.detached.spec.js +126 -0
- package/lib/test/intervalCollection.detached.spec.js.map +1 -0
- package/lib/test/intervalCollection.events.spec.js +491 -0
- package/lib/test/intervalCollection.events.spec.js.map +1 -0
- package/lib/test/intervalCollection.perf.spec.js +88 -0
- package/lib/test/intervalCollection.perf.spec.js.map +1 -0
- package/lib/test/intervalCollection.snapshot.spec.js +171 -0
- package/lib/test/intervalCollection.snapshot.spec.js.map +1 -0
- package/lib/test/intervalCollection.spec.js +1660 -0
- package/lib/test/intervalCollection.spec.js.map +1 -0
- package/lib/test/intervalIndexTestUtils.js +49 -0
- package/lib/test/intervalIndexTestUtils.js.map +1 -0
- package/lib/test/intervalRebasing.spec.js +589 -0
- package/lib/test/intervalRebasing.spec.js.map +1 -0
- package/lib/test/intervalStashedOps.spec.js +142 -0
- package/lib/test/intervalStashedOps.spec.js.map +1 -0
- package/lib/test/intervalTestUtils.js +81 -0
- package/lib/test/intervalTestUtils.js.map +1 -0
- package/lib/test/marshalling.spec.js +55 -0
- package/lib/test/marshalling.spec.js.map +1 -0
- package/lib/test/memory/sharedSequence.spec.js +82 -0
- package/lib/test/memory/sharedSequence.spec.js.map +1 -0
- package/lib/test/memory/sharedString.spec.js +134 -0
- package/lib/test/memory/sharedString.spec.js.map +1 -0
- package/lib/test/overlappingSequenceIntervalsIndex.spec.js +348 -0
- package/lib/test/overlappingSequenceIntervalsIndex.spec.js.map +1 -0
- package/lib/test/partialLoad.spec.js +211 -0
- package/lib/test/partialLoad.spec.js.map +1 -0
- package/lib/test/rebasing.spec.js +81 -0
- package/lib/test/rebasing.spec.js.map +1 -0
- package/lib/test/reentrancy.spec.js +174 -0
- package/lib/test/reentrancy.spec.js.map +1 -0
- package/lib/test/revertibles.spec.js +971 -0
- package/lib/test/revertibles.spec.js.map +1 -0
- package/lib/test/sequenceDeltaEvent.spec.js +2144 -0
- package/lib/test/sequenceDeltaEvent.spec.js.map +1 -0
- package/lib/test/sharedIntervalCollection.spec.js +159 -0
- package/lib/test/sharedIntervalCollection.spec.js.map +1 -0
- package/lib/test/sharedString.spec.js +532 -0
- package/lib/test/sharedString.spec.js.map +1 -0
- package/lib/test/snapshotEmptyProps.spec.js +45 -0
- package/lib/test/snapshotEmptyProps.spec.js.map +1 -0
- package/lib/test/snapshotVersion.spec.js +149 -0
- package/lib/test/snapshotVersion.spec.js.map +1 -0
- package/lib/test/startpointInRangeIndex.spec.js +182 -0
- package/lib/test/startpointInRangeIndex.spec.js.map +1 -0
- package/lib/test/subSequence.spec.js +92 -0
- package/lib/test/subSequence.spec.js.map +1 -0
- package/lib/test/types/validateSequencePrevious.generated.js +162 -0
- package/lib/test/types/validateSequencePrevious.generated.js.map +1 -0
- package/lib/test/v1IntervalCollectionHelpers.js +93 -0
- package/lib/test/v1IntervalCollectionHelpers.js.map +1 -0
- package/package.json +66 -60
- package/src/defaultMap.ts +97 -123
- package/src/defaultMapInterfaces.ts +1 -9
- package/src/index.ts +15 -11
- package/src/intervalCollection.ts +57 -84
- package/src/intervalIndex/endpointInRangeIndex.ts +4 -4
- package/src/intervalIndex/endpointIndex.ts +3 -3
- package/src/intervalIndex/idIntervalIndex.ts +3 -4
- package/src/intervalIndex/index.ts +8 -8
- package/src/intervalIndex/intervalIndex.ts +1 -1
- package/src/intervalIndex/overlappingIntervalsIndex.ts +10 -11
- package/src/intervalIndex/overlappingSequenceIntervalsIndex.ts +4 -4
- package/src/intervalIndex/sequenceIntervalIndexes.ts +2 -2
- package/src/intervalIndex/startpointInRangeIndex.ts +4 -4
- package/src/intervalTree.ts +1 -1
- package/src/intervals/index.ts +3 -3
- package/src/intervals/interval.ts +2 -4
- package/src/intervals/intervalUtils.ts +3 -3
- package/src/intervals/sequenceInterval.ts +3 -4
- package/src/localValues.ts +2 -2
- package/src/packageVersion.ts +1 -1
- package/src/revertibles.ts +13 -13
- package/src/sequence.ts +126 -44
- package/src/sequenceFactory.ts +5 -2
- package/src/sharedIntervalCollection.ts +5 -5
- package/src/sharedSequence.ts +1 -1
- package/src/sharedString.ts +2 -2
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/lib/defaultMap.d.mts.map +0 -1
- package/lib/defaultMap.mjs.map +0 -1
- package/lib/defaultMapInterfaces.d.mts.map +0 -1
- package/lib/defaultMapInterfaces.mjs.map +0 -1
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs.map +0 -1
- package/lib/intervalCollection.d.mts.map +0 -1
- package/lib/intervalCollection.mjs.map +0 -1
- package/lib/intervalIndex/endpointInRangeIndex.d.mts.map +0 -1
- package/lib/intervalIndex/endpointInRangeIndex.mjs.map +0 -1
- package/lib/intervalIndex/endpointIndex.d.mts.map +0 -1
- package/lib/intervalIndex/endpointIndex.mjs.map +0 -1
- package/lib/intervalIndex/idIntervalIndex.d.mts.map +0 -1
- package/lib/intervalIndex/idIntervalIndex.mjs.map +0 -1
- package/lib/intervalIndex/index.d.mts.map +0 -1
- package/lib/intervalIndex/index.mjs.map +0 -1
- package/lib/intervalIndex/intervalIndex.d.mts.map +0 -1
- package/lib/intervalIndex/intervalIndex.mjs.map +0 -1
- package/lib/intervalIndex/intervalIndexUtils.d.mts.map +0 -1
- package/lib/intervalIndex/intervalIndexUtils.mjs.map +0 -1
- package/lib/intervalIndex/overlappingIntervalsIndex.d.mts.map +0 -1
- package/lib/intervalIndex/overlappingIntervalsIndex.mjs.map +0 -1
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.mts.map +0 -1
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.mjs.map +0 -1
- package/lib/intervalIndex/sequenceIntervalIndexes.d.mts.map +0 -1
- package/lib/intervalIndex/sequenceIntervalIndexes.mjs.map +0 -1
- package/lib/intervalIndex/startpointInRangeIndex.d.mts.map +0 -1
- package/lib/intervalIndex/startpointInRangeIndex.mjs.map +0 -1
- package/lib/intervalTree.d.mts.map +0 -1
- package/lib/intervalTree.mjs.map +0 -1
- package/lib/intervals/index.d.mts.map +0 -1
- package/lib/intervals/index.mjs.map +0 -1
- package/lib/intervals/interval.mjs.map +0 -1
- package/lib/intervals/intervalUtils.d.mts.map +0 -1
- package/lib/intervals/intervalUtils.mjs.map +0 -1
- package/lib/intervals/sequenceInterval.d.mts.map +0 -1
- package/lib/localValues.mjs.map +0 -1
- package/lib/packageVersion.d.mts.map +0 -1
- package/lib/packageVersion.mjs.map +0 -1
- package/lib/revertibles.d.mts.map +0 -1
- package/lib/revertibles.mjs.map +0 -1
- package/lib/sequence.d.mts.map +0 -1
- package/lib/sequence.mjs.map +0 -1
- package/lib/sequenceDeltaEvent.d.mts.map +0 -1
- package/lib/sequenceDeltaEvent.mjs.map +0 -1
- package/lib/sequenceFactory.d.mts.map +0 -1
- package/lib/sequenceFactory.mjs.map +0 -1
- package/lib/sharedIntervalCollection.d.mts.map +0 -1
- package/lib/sharedIntervalCollection.mjs.map +0 -1
- package/lib/sharedSequence.d.mts.map +0 -1
- package/lib/sharedSequence.mjs.map +0 -1
- package/lib/sharedString.d.mts.map +0 -1
- package/lib/sharedString.mjs.map +0 -1
|
@@ -59,32 +59,32 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
|
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Create revertibles for adding an interval
|
|
62
|
-
* @
|
|
62
|
+
* @alpha
|
|
63
63
|
*/
|
|
64
64
|
export declare function appendAddIntervalToRevertibles(interval: SequenceInterval, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* Create revertibles for moving endpoints of an interval
|
|
68
|
-
* @
|
|
68
|
+
* @alpha
|
|
69
69
|
*/
|
|
70
70
|
export declare function appendChangeIntervalToRevertibles(string: SharedString, newInterval: SequenceInterval, previousInterval: SequenceInterval, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* Create revertibles for deleting an interval
|
|
74
|
-
* @
|
|
74
|
+
* @alpha
|
|
75
75
|
*/
|
|
76
76
|
export declare function appendDeleteIntervalToRevertibles(string: SharedString, interval: SequenceInterval, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* Create revertibles for changing properties of an interval
|
|
80
|
-
* @
|
|
80
|
+
* @alpha
|
|
81
81
|
*/
|
|
82
82
|
export declare function appendIntervalPropertyChangedToRevertibles(interval: SequenceInterval, deltas: PropertySet, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Create revertibles for SharedStringDeltas, handling indirectly modified intervals
|
|
86
86
|
* (e.g. reverting remove of a range that contains an interval will move the interval back)
|
|
87
|
-
* @
|
|
87
|
+
* @alpha
|
|
88
88
|
*/
|
|
89
89
|
export declare function appendSharedStringDeltaToRevertibles(string: SharedString, delta: SequenceDeltaEvent, revertibles: SharedStringRevertible[]): void;
|
|
90
90
|
|
|
@@ -106,7 +106,7 @@ export declare function createEndpointInRangeIndex(sharedString: SharedString):
|
|
|
106
106
|
export declare function createIdIntervalIndex<TInterval extends ISerializableInterval>(): IIdIntervalIndex<TInterval>;
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
|
-
* @
|
|
109
|
+
* @alpha
|
|
110
110
|
*/
|
|
111
111
|
export declare function createOverlappingIntervalsIndex(sharedString: SharedString): IOverlappingIntervalsIndex<SequenceInterval>;
|
|
112
112
|
|
|
@@ -127,7 +127,7 @@ export declare type DeserializeCallback = (properties: PropertySet) => void;
|
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* Clean up resources held by revertibles that are no longer needed.
|
|
130
|
-
* @
|
|
130
|
+
* @alpha
|
|
131
131
|
*/
|
|
132
132
|
export declare function discardSharedStringRevertibles(sharedString: SharedString, revertibles: SharedStringRevertible[]): void;
|
|
133
133
|
|
|
@@ -465,6 +465,19 @@ export declare interface IIntervalCollectionEvent<TInterval extends ISerializabl
|
|
|
465
465
|
* `op` is defined if and only if the server has acked this change.
|
|
466
466
|
*/
|
|
467
467
|
(event: "propertyChanged", listener: (interval: TInterval, propertyDeltas: PropertySet, local: boolean, op: ISequencedDocumentMessage | undefined) => void): void;
|
|
468
|
+
/**
|
|
469
|
+
* This event is invoked whenever an interval's endpoints or properties (or both) have changed.
|
|
470
|
+
* `interval` reflects the state of the updated endpoints or properties.
|
|
471
|
+
* `propertyDeltas` is a map-like whose keys contain all values that were changed, and whose
|
|
472
|
+
* values contain all previous values of the property set.
|
|
473
|
+
* This object can be used directly in a call to `changeProperties` to revert the property change if desired.
|
|
474
|
+
* 'previousInterval' contains transient `ReferencePosition`s at the same location as the interval's original
|
|
475
|
+
* endpoints. These references should be used for position information only. In the case of a property change
|
|
476
|
+
* only, this argument should be undefined.
|
|
477
|
+
* `local` reflects whether the change originated locally.
|
|
478
|
+
* `slide` is true if the change is due to sliding on removal of position.
|
|
479
|
+
*/
|
|
480
|
+
(event: "changed", listener: (interval: TInterval, propertyDeltas: PropertySet, previousInterval: TInterval | undefined, local: boolean, slide: boolean) => void): void;
|
|
468
481
|
}
|
|
469
482
|
|
|
470
483
|
/**
|
|
@@ -642,7 +655,7 @@ export declare function intervalLocatorFromEndpoint(potentialEndpoint: LocalRefe
|
|
|
642
655
|
|
|
643
656
|
/**
|
|
644
657
|
* Values are used in revertibles.
|
|
645
|
-
* @
|
|
658
|
+
* @alpha
|
|
646
659
|
*/
|
|
647
660
|
export declare const IntervalOpType: {
|
|
648
661
|
readonly PROPERTY_CHANGED: "propertyChanged";
|
|
@@ -653,13 +666,13 @@ export declare const IntervalOpType: {
|
|
|
653
666
|
};
|
|
654
667
|
|
|
655
668
|
/**
|
|
656
|
-
* @
|
|
669
|
+
* @alpha
|
|
657
670
|
*/
|
|
658
671
|
export declare type IntervalOpType = (typeof IntervalOpType)[keyof typeof IntervalOpType];
|
|
659
672
|
|
|
660
673
|
/**
|
|
661
674
|
* Data for undoing edits affecting Intervals.
|
|
662
|
-
* @
|
|
675
|
+
* @alpha
|
|
663
676
|
*/
|
|
664
677
|
export declare type IntervalRevertible = {
|
|
665
678
|
event: typeof IntervalOpType.CHANGE;
|
|
@@ -754,7 +767,7 @@ export declare enum IntervalType {
|
|
|
754
767
|
}
|
|
755
768
|
|
|
756
769
|
/**
|
|
757
|
-
* @
|
|
770
|
+
* @alpha
|
|
758
771
|
*/
|
|
759
772
|
export declare interface IOverlappingIntervalsIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
|
|
760
773
|
/**
|
|
@@ -981,7 +994,7 @@ export { reservedTileLabelsKey }
|
|
|
981
994
|
|
|
982
995
|
/**
|
|
983
996
|
* Invoke revertibles to reverse prior edits
|
|
984
|
-
* @
|
|
997
|
+
* @alpha
|
|
985
998
|
*/
|
|
986
999
|
export declare function revertSharedStringRevertibles(sharedString: SharedString, revertibles: SharedStringRevertible[]): void;
|
|
987
1000
|
|
|
@@ -1355,6 +1368,35 @@ export declare abstract class SharedSegmentSequence<T extends ISegment> extends
|
|
|
1355
1368
|
*/
|
|
1356
1369
|
protected guardReentrancy: <TRet>(callback: () => TRet) => TRet;
|
|
1357
1370
|
private static createOpsFromDelta;
|
|
1371
|
+
/**
|
|
1372
|
+
* Note: this field only provides a lower-bound on the reference sequence numbers for in-flight ops.
|
|
1373
|
+
* The exact reason isn't understood, but some e2e tests suggest that the runtime may sometimes process
|
|
1374
|
+
* incoming leave/join ops before putting an op that this DDS submits over the wire.
|
|
1375
|
+
*
|
|
1376
|
+
* E.g. SharedString submits an op while deltaManager has lastSequenceNumber = 10, but before the runtime
|
|
1377
|
+
* puts this op over the wire, it processes a client join/leave op with sequence number 11, so the referenceSequenceNumber
|
|
1378
|
+
* on the SharedString op is 11.
|
|
1379
|
+
*
|
|
1380
|
+
* The reference sequence numbers placed in this queue are also not accurate for stashed ops due to how the applyStashedOp
|
|
1381
|
+
* flow works at the runtime level. This is a legitimate bug, and AB#6602 tracks one way to fix it (stop reaching all the way
|
|
1382
|
+
* to deltaManager's lastSequenceNumber to obtain refSeq, instead leveraging some analogous notion on the container or datastore
|
|
1383
|
+
* runtime).
|
|
1384
|
+
*/
|
|
1385
|
+
private readonly inFlightRefSeqs;
|
|
1386
|
+
private ongoingResubmitRefSeq;
|
|
1387
|
+
/**
|
|
1388
|
+
* Gets the reference sequence number (i.e. sequence number of the runtime's last processed op) for an op submitted
|
|
1389
|
+
* in the current context.
|
|
1390
|
+
*
|
|
1391
|
+
* This value can be optionally overridden using `useResubmitRefSeq`.
|
|
1392
|
+
* IntervalCollection's resubmit logic currently relies on preserving merge information from when the op was originally submitted,
|
|
1393
|
+
* even if the op is resubmitted more than once. Thus during resubmit, `inFlightRefSeqs` gets populated with the
|
|
1394
|
+
* original refSeq rather than the refSeq at the time of reconnection.
|
|
1395
|
+
*
|
|
1396
|
+
* @remarks - In some not fully understood cases, the runtime may process incoming ops before putting an op that this
|
|
1397
|
+
* DDS submits over the wire. See `inFlightRefSeqs` for more details.
|
|
1398
|
+
*/
|
|
1399
|
+
private get currentRefSeq();
|
|
1358
1400
|
protected client: Client;
|
|
1359
1401
|
/** `Deferred` that triggers once the object is loaded */
|
|
1360
1402
|
protected loadedDeferred: Deferred<void>;
|
|
@@ -1427,6 +1469,11 @@ export declare abstract class SharedSegmentSequence<T extends ISegment> extends
|
|
|
1427
1469
|
createLocalReferencePosition(segment: T, offset: number, refType: ReferenceType, properties: PropertySet | undefined, slidingPreference?: SlidingPreference, canSlideToEndpoint?: boolean): LocalReferencePosition;
|
|
1428
1470
|
/**
|
|
1429
1471
|
* Resolves a `ReferencePosition` into a character position using this client's perspective.
|
|
1472
|
+
*
|
|
1473
|
+
* Reference positions that point to a character that has been removed will
|
|
1474
|
+
* always return the position of the nearest non-removed character, regardless
|
|
1475
|
+
* of `ReferenceType`. To handle this case specifically, one may wish
|
|
1476
|
+
* to look at the segment returned by `ReferencePosition.getSegment`.
|
|
1430
1477
|
*/
|
|
1431
1478
|
localReferencePositionToPosition(lref: ReferencePosition): number;
|
|
1432
1479
|
/**
|
|
@@ -1555,12 +1602,21 @@ export declare abstract class SharedSegmentSequence<T extends ISegment> extends
|
|
|
1555
1602
|
/**
|
|
1556
1603
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
1557
1604
|
*/
|
|
1558
|
-
protected applyStashedOp(content: any):
|
|
1605
|
+
protected applyStashedOp(content: any): void;
|
|
1559
1606
|
private summarizeMergeTree;
|
|
1607
|
+
/**
|
|
1608
|
+
*
|
|
1609
|
+
* @param message - Message with decoded and hydrated handles
|
|
1610
|
+
*/
|
|
1560
1611
|
private processMergeTreeMsg;
|
|
1561
1612
|
private processMinSequenceNumberChanged;
|
|
1562
1613
|
private loadFinished;
|
|
1563
1614
|
private initializeIntervalCollections;
|
|
1615
|
+
/**
|
|
1616
|
+
* Overrides the "currently applicable reference sequence number" for the duration of the callback.
|
|
1617
|
+
* See remarks on `currentRefSeq` for more context.
|
|
1618
|
+
*/
|
|
1619
|
+
private useResubmitRefSeq;
|
|
1564
1620
|
}
|
|
1565
1621
|
|
|
1566
1622
|
/**
|
|
@@ -1709,12 +1765,15 @@ export declare class SharedStringFactory implements IChannelFactory {
|
|
|
1709
1765
|
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
|
|
1710
1766
|
*/
|
|
1711
1767
|
load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<SharedString>;
|
|
1768
|
+
/**
|
|
1769
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
|
|
1770
|
+
*/
|
|
1712
1771
|
create(document: IFluidDataStoreRuntime, id: string): SharedString;
|
|
1713
1772
|
}
|
|
1714
1773
|
|
|
1715
1774
|
/**
|
|
1716
1775
|
* Data for undoing edits on SharedStrings and Intervals.
|
|
1717
|
-
* @
|
|
1776
|
+
* @alpha
|
|
1718
1777
|
*/
|
|
1719
1778
|
export declare type SharedStringRevertible = MergeTreeDeltaRevertible | IntervalRevertible;
|
|
1720
1779
|
|
package/dist/sequence.d.ts
CHANGED
|
@@ -9,10 +9,10 @@ import { Client, IJSONSegment, IMergeTreeGroupMsg, IRelativePosition, ISegment,
|
|
|
9
9
|
import { IFluidSerializer, SharedObject, ISharedObjectEvents } from "@fluidframework/shared-object-base";
|
|
10
10
|
import { IEventThisPlaceHolder } from "@fluidframework/core-interfaces";
|
|
11
11
|
import { ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
12
|
-
import { SequenceInterval } from "./intervals";
|
|
13
|
-
import { IIntervalCollection } from "./intervalCollection";
|
|
14
|
-
import { SequenceDeltaEvent, SequenceMaintenanceEvent } from "./sequenceDeltaEvent";
|
|
15
|
-
import { ISharedIntervalCollection } from "./sharedIntervalCollection";
|
|
12
|
+
import { SequenceInterval } from "./intervals/index.js";
|
|
13
|
+
import { IIntervalCollection } from "./intervalCollection.js";
|
|
14
|
+
import { SequenceDeltaEvent, SequenceMaintenanceEvent } from "./sequenceDeltaEvent.js";
|
|
15
|
+
import { ISharedIntervalCollection } from "./sharedIntervalCollection.js";
|
|
16
16
|
/**
|
|
17
17
|
* Events emitted in response to changes to the sequence data.
|
|
18
18
|
*
|
|
@@ -74,6 +74,35 @@ export declare abstract class SharedSegmentSequence<T extends ISegment> extends
|
|
|
74
74
|
*/
|
|
75
75
|
protected guardReentrancy: <TRet>(callback: () => TRet) => TRet;
|
|
76
76
|
private static createOpsFromDelta;
|
|
77
|
+
/**
|
|
78
|
+
* Note: this field only provides a lower-bound on the reference sequence numbers for in-flight ops.
|
|
79
|
+
* The exact reason isn't understood, but some e2e tests suggest that the runtime may sometimes process
|
|
80
|
+
* incoming leave/join ops before putting an op that this DDS submits over the wire.
|
|
81
|
+
*
|
|
82
|
+
* E.g. SharedString submits an op while deltaManager has lastSequenceNumber = 10, but before the runtime
|
|
83
|
+
* puts this op over the wire, it processes a client join/leave op with sequence number 11, so the referenceSequenceNumber
|
|
84
|
+
* on the SharedString op is 11.
|
|
85
|
+
*
|
|
86
|
+
* The reference sequence numbers placed in this queue are also not accurate for stashed ops due to how the applyStashedOp
|
|
87
|
+
* flow works at the runtime level. This is a legitimate bug, and AB#6602 tracks one way to fix it (stop reaching all the way
|
|
88
|
+
* to deltaManager's lastSequenceNumber to obtain refSeq, instead leveraging some analogous notion on the container or datastore
|
|
89
|
+
* runtime).
|
|
90
|
+
*/
|
|
91
|
+
private readonly inFlightRefSeqs;
|
|
92
|
+
private ongoingResubmitRefSeq;
|
|
93
|
+
/**
|
|
94
|
+
* Gets the reference sequence number (i.e. sequence number of the runtime's last processed op) for an op submitted
|
|
95
|
+
* in the current context.
|
|
96
|
+
*
|
|
97
|
+
* This value can be optionally overridden using `useResubmitRefSeq`.
|
|
98
|
+
* IntervalCollection's resubmit logic currently relies on preserving merge information from when the op was originally submitted,
|
|
99
|
+
* even if the op is resubmitted more than once. Thus during resubmit, `inFlightRefSeqs` gets populated with the
|
|
100
|
+
* original refSeq rather than the refSeq at the time of reconnection.
|
|
101
|
+
*
|
|
102
|
+
* @remarks - In some not fully understood cases, the runtime may process incoming ops before putting an op that this
|
|
103
|
+
* DDS submits over the wire. See `inFlightRefSeqs` for more details.
|
|
104
|
+
*/
|
|
105
|
+
private get currentRefSeq();
|
|
77
106
|
protected client: Client;
|
|
78
107
|
/** `Deferred` that triggers once the object is loaded */
|
|
79
108
|
protected loadedDeferred: Deferred<void>;
|
|
@@ -146,6 +175,11 @@ export declare abstract class SharedSegmentSequence<T extends ISegment> extends
|
|
|
146
175
|
createLocalReferencePosition(segment: T, offset: number, refType: ReferenceType, properties: PropertySet | undefined, slidingPreference?: SlidingPreference, canSlideToEndpoint?: boolean): LocalReferencePosition;
|
|
147
176
|
/**
|
|
148
177
|
* Resolves a `ReferencePosition` into a character position using this client's perspective.
|
|
178
|
+
*
|
|
179
|
+
* Reference positions that point to a character that has been removed will
|
|
180
|
+
* always return the position of the nearest non-removed character, regardless
|
|
181
|
+
* of `ReferenceType`. To handle this case specifically, one may wish
|
|
182
|
+
* to look at the segment returned by `ReferencePosition.getSegment`.
|
|
149
183
|
*/
|
|
150
184
|
localReferencePositionToPosition(lref: ReferencePosition): number;
|
|
151
185
|
/**
|
|
@@ -274,12 +308,21 @@ export declare abstract class SharedSegmentSequence<T extends ISegment> extends
|
|
|
274
308
|
/**
|
|
275
309
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
276
310
|
*/
|
|
277
|
-
protected applyStashedOp(content: any):
|
|
311
|
+
protected applyStashedOp(content: any): void;
|
|
278
312
|
private summarizeMergeTree;
|
|
313
|
+
/**
|
|
314
|
+
*
|
|
315
|
+
* @param message - Message with decoded and hydrated handles
|
|
316
|
+
*/
|
|
279
317
|
private processMergeTreeMsg;
|
|
280
318
|
private processMinSequenceNumberChanged;
|
|
281
319
|
private loadFinished;
|
|
282
320
|
private initializeIntervalCollections;
|
|
321
|
+
/**
|
|
322
|
+
* Overrides the "currently applicable reference sequence number" for the duration of the callback.
|
|
323
|
+
* See remarks on `currentRefSeq` for more context.
|
|
324
|
+
*/
|
|
325
|
+
private useResubmitRefSeq;
|
|
283
326
|
}
|
|
284
327
|
/**
|
|
285
328
|
* Resets the reentrancy log counter. Test-only API.
|
package/dist/sequence.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequence.d.ts","sourceRoot":"","sources":["../src/sequence.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"sequence.d.ts","sourceRoot":"","sources":["../src/sequence.ts"],"names":[],"mappings":"AA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QnB;;OAEG;IACH,SAAS,CAAC,mBAAmB;IAK7B;;OAEG;IACH,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI;IAM5C,OAAO,CAAC,kBAAkB;IAsB1B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAwC3B,OAAO,CAAC,+BAA+B;IAYvC,OAAO,CAAC,YAAY;IA6BpB,OAAO,CAAC,6BAA6B;IAwBrC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;CASzB;AA4BD;;GAEG;AACH,wBAAgB,yBAAyB,SAExC"}
|
package/dist/sequence.js
CHANGED
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
6
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
10
|
exports.resetReentrancyLogCounter = exports.SharedSegmentSequence = void 0;
|
|
11
|
+
const double_ended_queue_1 = __importDefault(require("double-ended-queue"));
|
|
8
12
|
const core_utils_1 = require("@fluidframework/core-utils");
|
|
9
13
|
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
10
14
|
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
@@ -12,9 +16,9 @@ const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
|
12
16
|
const merge_tree_1 = require("@fluidframework/merge-tree");
|
|
13
17
|
const runtime_utils_1 = require("@fluidframework/runtime-utils");
|
|
14
18
|
const shared_object_base_1 = require("@fluidframework/shared-object-base");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
19
|
+
const defaultMap_js_1 = require("./defaultMap.js");
|
|
20
|
+
const intervalCollection_js_1 = require("./intervalCollection.js");
|
|
21
|
+
const sequenceDeltaEvent_js_1 = require("./sequenceDeltaEvent.js");
|
|
18
22
|
const snapshotFileName = "header";
|
|
19
23
|
const contentPath = "content";
|
|
20
24
|
/**
|
|
@@ -74,11 +78,41 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
|
|
|
74
78
|
}
|
|
75
79
|
return ops;
|
|
76
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Gets the reference sequence number (i.e. sequence number of the runtime's last processed op) for an op submitted
|
|
83
|
+
* in the current context.
|
|
84
|
+
*
|
|
85
|
+
* This value can be optionally overridden using `useResubmitRefSeq`.
|
|
86
|
+
* IntervalCollection's resubmit logic currently relies on preserving merge information from when the op was originally submitted,
|
|
87
|
+
* even if the op is resubmitted more than once. Thus during resubmit, `inFlightRefSeqs` gets populated with the
|
|
88
|
+
* original refSeq rather than the refSeq at the time of reconnection.
|
|
89
|
+
*
|
|
90
|
+
* @remarks - In some not fully understood cases, the runtime may process incoming ops before putting an op that this
|
|
91
|
+
* DDS submits over the wire. See `inFlightRefSeqs` for more details.
|
|
92
|
+
*/
|
|
93
|
+
get currentRefSeq() {
|
|
94
|
+
return this.ongoingResubmitRefSeq ?? this.runtime.deltaManager.lastSequenceNumber;
|
|
95
|
+
}
|
|
77
96
|
constructor(dataStoreRuntime, id, attributes, segmentFromSpec) {
|
|
78
97
|
super(id, dataStoreRuntime, attributes, "fluid_sequence_");
|
|
79
98
|
this.dataStoreRuntime = dataStoreRuntime;
|
|
80
99
|
this.id = id;
|
|
81
100
|
this.segmentFromSpec = segmentFromSpec;
|
|
101
|
+
/**
|
|
102
|
+
* Note: this field only provides a lower-bound on the reference sequence numbers for in-flight ops.
|
|
103
|
+
* The exact reason isn't understood, but some e2e tests suggest that the runtime may sometimes process
|
|
104
|
+
* incoming leave/join ops before putting an op that this DDS submits over the wire.
|
|
105
|
+
*
|
|
106
|
+
* E.g. SharedString submits an op while deltaManager has lastSequenceNumber = 10, but before the runtime
|
|
107
|
+
* puts this op over the wire, it processes a client join/leave op with sequence number 11, so the referenceSequenceNumber
|
|
108
|
+
* on the SharedString op is 11.
|
|
109
|
+
*
|
|
110
|
+
* The reference sequence numbers placed in this queue are also not accurate for stashed ops due to how the applyStashedOp
|
|
111
|
+
* flow works at the runtime level. This is a legitimate bug, and AB#6602 tracks one way to fix it (stop reaching all the way
|
|
112
|
+
* to deltaManager's lastSequenceNumber to obtain refSeq, instead leveraging some analogous notion on the container or datastore
|
|
113
|
+
* runtime).
|
|
114
|
+
*/
|
|
115
|
+
this.inFlightRefSeqs = new double_ended_queue_1.default();
|
|
82
116
|
/** `Deferred` that triggers once the object is loaded */
|
|
83
117
|
this.loadedDeferred = new core_utils_1.Deferred();
|
|
84
118
|
// cache out going ops created when partial loading
|
|
@@ -87,6 +121,7 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
|
|
|
87
121
|
this.deferIncomingOps = true;
|
|
88
122
|
this.loadedDeferredIncomingOps = [];
|
|
89
123
|
this.messagesSinceMSNChange = [];
|
|
124
|
+
const getMinInFlightRefSeq = () => this.inFlightRefSeqs.get(0);
|
|
90
125
|
this.guardReentrancy =
|
|
91
126
|
dataStoreRuntime.options.sharedStringPreventReentrancy ?? true
|
|
92
127
|
? ensureNoReentrancy
|
|
@@ -103,18 +138,24 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
|
|
|
103
138
|
this.client = new merge_tree_1.Client(segmentFromSpec, (0, telemetry_utils_1.createChildLogger)({
|
|
104
139
|
logger: this.logger,
|
|
105
140
|
namespace: "SharedSegmentSequence.MergeTreeClient",
|
|
106
|
-
}), dataStoreRuntime.options);
|
|
141
|
+
}), dataStoreRuntime.options, getMinInFlightRefSeq);
|
|
107
142
|
this.client.prependListener("delta", (opArgs, deltaArgs) => {
|
|
108
|
-
const event = new
|
|
109
|
-
if (
|
|
143
|
+
const event = new sequenceDeltaEvent_js_1.SequenceDeltaEvent(opArgs, deltaArgs, this.client);
|
|
144
|
+
if (event.isLocal) {
|
|
110
145
|
this.submitSequenceMessage(opArgs.op);
|
|
111
146
|
}
|
|
112
147
|
this.emit("sequenceDelta", event, this);
|
|
113
148
|
});
|
|
114
149
|
this.client.on("maintenance", (args, opArgs) => {
|
|
115
|
-
this.emit("maintenance", new
|
|
150
|
+
this.emit("maintenance", new sequenceDeltaEvent_js_1.SequenceMaintenanceEvent(opArgs, args, this.client), this);
|
|
116
151
|
});
|
|
117
|
-
this.intervalCollections = new
|
|
152
|
+
this.intervalCollections = new defaultMap_js_1.DefaultMap(this.serializer, this.handle, (op, localOpMetadata) => {
|
|
153
|
+
if (!this.isAttached()) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
this.inFlightRefSeqs.push(this.currentRefSeq);
|
|
157
|
+
this.submitLocalMessage(op, localOpMetadata);
|
|
158
|
+
}, new intervalCollection_js_1.SequenceIntervalCollectionValueType(), dataStoreRuntime.options);
|
|
118
159
|
}
|
|
119
160
|
/**
|
|
120
161
|
* @param start - The inclusive start of the range to remove
|
|
@@ -193,6 +234,11 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
|
|
|
193
234
|
}
|
|
194
235
|
/**
|
|
195
236
|
* Resolves a `ReferencePosition` into a character position using this client's perspective.
|
|
237
|
+
*
|
|
238
|
+
* Reference positions that point to a character that has been removed will
|
|
239
|
+
* always return the position of the nearest non-removed character, regardless
|
|
240
|
+
* of `ReferenceType`. To handle this case specifically, one may wish
|
|
241
|
+
* to look at the segment returned by `ReferencePosition.getSegment`.
|
|
196
242
|
*/
|
|
197
243
|
localReferencePositionToPosition(lref) {
|
|
198
244
|
return this.client.localReferencePositionToPosition(lref);
|
|
@@ -224,16 +270,16 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
|
|
|
224
270
|
if (!this.isAttached()) {
|
|
225
271
|
return;
|
|
226
272
|
}
|
|
227
|
-
|
|
273
|
+
this.inFlightRefSeqs.push(this.currentRefSeq);
|
|
228
274
|
const metadata = this.client.peekPendingSegmentGroups(message.type === merge_tree_1.MergeTreeDeltaType.GROUP ? message.ops.length : 1);
|
|
229
275
|
// if loading isn't complete, we need to cache
|
|
230
276
|
// local ops until loading is complete, and then
|
|
231
277
|
// they will be present
|
|
232
278
|
if (!this.loadedDeferred.isCompleted) {
|
|
233
|
-
this.loadedDeferredOutgoingOps.push(metadata ? [
|
|
279
|
+
this.loadedDeferredOutgoingOps.push(metadata ? [message, metadata] : message);
|
|
234
280
|
}
|
|
235
281
|
else {
|
|
236
|
-
this.submitLocalMessage(
|
|
282
|
+
this.submitLocalMessage(message, metadata);
|
|
237
283
|
}
|
|
238
284
|
}
|
|
239
285
|
/**
|
|
@@ -343,11 +389,9 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
|
|
|
343
389
|
// Insert at the max end of the range when start > end, but still remove the range later
|
|
344
390
|
const insertIndex = Math.max(start, end);
|
|
345
391
|
// Insert first, so local references can slide to the inserted seg if any
|
|
346
|
-
const insert = this.client.insertSegmentLocal(insertIndex, segment);
|
|
347
|
-
if (insert) {
|
|
348
|
-
|
|
349
|
-
this.client.removeRangeLocal(start, end);
|
|
350
|
-
}
|
|
392
|
+
const insert = this.guardReentrancy(() => this.client.insertSegmentLocal(insertIndex, segment));
|
|
393
|
+
if (insert && start < end) {
|
|
394
|
+
this.removeRange(start, end);
|
|
351
395
|
}
|
|
352
396
|
}
|
|
353
397
|
/**
|
|
@@ -365,9 +409,13 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
|
|
|
365
409
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}
|
|
366
410
|
*/
|
|
367
411
|
reSubmitCore(content, localOpMetadata) {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
412
|
+
const originalRefSeq = this.inFlightRefSeqs.shift();
|
|
413
|
+
(0, core_utils_1.assert)(originalRefSeq !== undefined, 0x8bb /* Expected a recorded refSeq when resubmitting an op */);
|
|
414
|
+
this.useResubmitRefSeq(originalRefSeq, () => {
|
|
415
|
+
if (!this.intervalCollections.tryResubmitMessage(content, localOpMetadata)) {
|
|
416
|
+
this.submitSequenceMessage(this.client.regeneratePendingOp(content, localOpMetadata));
|
|
417
|
+
}
|
|
418
|
+
});
|
|
371
419
|
}
|
|
372
420
|
/**
|
|
373
421
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
@@ -413,7 +461,7 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
|
|
|
413
461
|
.catch((error) => {
|
|
414
462
|
this.loadFinished(error);
|
|
415
463
|
});
|
|
416
|
-
if (this.dataStoreRuntime.options
|
|
464
|
+
if (this.dataStoreRuntime.options.sequenceInitializeFromHeaderOnly !== true) {
|
|
417
465
|
// if we not doing partial load, await the catch up ops,
|
|
418
466
|
// and the finalization of the load
|
|
419
467
|
await loadCatchUpOps;
|
|
@@ -427,6 +475,17 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
|
|
|
427
475
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
|
|
428
476
|
*/
|
|
429
477
|
processCore(message, local, localOpMetadata) {
|
|
478
|
+
if (local) {
|
|
479
|
+
const recordedRefSeq = this.inFlightRefSeqs.shift();
|
|
480
|
+
(0, core_utils_1.assert)(recordedRefSeq !== undefined, 0x8bc /* No pending recorded refSeq found */);
|
|
481
|
+
// TODO: AB#7076: Some equivalent assert should be enabled. This fails some e2e stashed op tests because
|
|
482
|
+
// the deltaManager may have seen more messages than the runtime has processed while amidst the stashed op
|
|
483
|
+
// flow, so e.g. when `applyStashedOp` is called and the DDS is put in a state where it expects an ack for
|
|
484
|
+
// one of its messages, the delta manager has actually already seen subsequent messages from collaborators
|
|
485
|
+
// which the in-flight message is concurrent to.
|
|
486
|
+
// See "handles stashed ops created on top of sequenced local ops" for one such test case.
|
|
487
|
+
// assert(recordedRefSeq <= message.referenceSequenceNumber, "RefSeq mismatch");
|
|
488
|
+
}
|
|
430
489
|
// if loading isn't complete, we need to cache all
|
|
431
490
|
// incoming ops to be applied after loading is complete
|
|
432
491
|
if (this.deferIncomingOps) {
|
|
@@ -462,11 +521,9 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
|
|
|
462
521
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
463
522
|
*/
|
|
464
523
|
applyStashedOp(content) {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
(0, core_utils_1.assert)(!!metadata, 0x87d /* Metadata is undefined */);
|
|
469
|
-
return metadata;
|
|
524
|
+
if (!this.intervalCollections.tryApplyStashedOp(content)) {
|
|
525
|
+
this.client.applyStashedOp(content);
|
|
526
|
+
}
|
|
470
527
|
}
|
|
471
528
|
summarizeMergeTree(serializer) {
|
|
472
529
|
// Are we fully loaded? If not, things will go south
|
|
@@ -478,21 +535,24 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
|
|
|
478
535
|
});
|
|
479
536
|
return this.client.summarize(this.runtime, this.handle, serializer, this.messagesSinceMSNChange);
|
|
480
537
|
}
|
|
481
|
-
|
|
482
|
-
|
|
538
|
+
/**
|
|
539
|
+
*
|
|
540
|
+
* @param message - Message with decoded and hydrated handles
|
|
541
|
+
*/
|
|
542
|
+
processMergeTreeMsg(message, local) {
|
|
483
543
|
const ops = [];
|
|
484
544
|
function transformOps(event) {
|
|
485
545
|
ops.push(...SharedSegmentSequence.createOpsFromDelta(event));
|
|
486
546
|
}
|
|
487
547
|
const needsTransformation = message.referenceSequenceNumber !== message.sequenceNumber - 1;
|
|
488
548
|
let stashMessage = message;
|
|
489
|
-
if (this.runtime.options
|
|
549
|
+
if (this.runtime.options.newMergeTreeSnapshotFormat !== true) {
|
|
490
550
|
if (needsTransformation) {
|
|
491
551
|
this.on("sequenceDelta", transformOps);
|
|
492
552
|
}
|
|
493
553
|
}
|
|
494
554
|
this.client.applyMsg(message, local);
|
|
495
|
-
if (this.runtime.options
|
|
555
|
+
if (this.runtime.options.newMergeTreeSnapshotFormat !== true) {
|
|
496
556
|
if (needsTransformation) {
|
|
497
557
|
this.removeListener("sequenceDelta", transformOps);
|
|
498
558
|
// shallow clone the message as we only overwrite top level properties,
|
|
@@ -566,6 +626,20 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
|
|
|
566
626
|
intervalCollection.attachGraph(this.client, key);
|
|
567
627
|
}
|
|
568
628
|
}
|
|
629
|
+
/**
|
|
630
|
+
* Overrides the "currently applicable reference sequence number" for the duration of the callback.
|
|
631
|
+
* See remarks on `currentRefSeq` for more context.
|
|
632
|
+
*/
|
|
633
|
+
useResubmitRefSeq(refSeq, callback) {
|
|
634
|
+
const previousResubmitRefSeq = this.ongoingResubmitRefSeq;
|
|
635
|
+
this.ongoingResubmitRefSeq = refSeq;
|
|
636
|
+
try {
|
|
637
|
+
callback();
|
|
638
|
+
}
|
|
639
|
+
finally {
|
|
640
|
+
this.ongoingResubmitRefSeq = previousResubmitRefSeq;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
569
643
|
}
|
|
570
644
|
exports.SharedSegmentSequence = SharedSegmentSequence;
|
|
571
645
|
function createReentrancyDetector(onReentrancy) {
|