@fluidframework/runtime-utils
Advanced tools
Comparing version 0.27.0 to 0.27.1
@@ -8,3 +8,3 @@ /*! | ||
export declare const pkgName = "@fluidframework/runtime-utils"; | ||
export declare const pkgVersion = "0.27.0"; | ||
export declare const pkgVersion = "0.27.1"; | ||
//# sourceMappingURL=packageVersion.d.ts.map |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.pkgName = "@fluidframework/runtime-utils"; | ||
exports.pkgVersion = "0.27.0"; | ||
exports.pkgVersion = "0.27.1"; | ||
//# sourceMappingURL=packageVersion.js.map |
@@ -31,3 +31,2 @@ /*! | ||
private readonly initialSummary?; | ||
private trackingSequenceNumber; | ||
/** | ||
@@ -40,3 +39,3 @@ * The reference sequence number of the most recent acked summary. | ||
private readonly pendingSummaries; | ||
private outstandingOps; | ||
private readonly outstandingOps; | ||
private wipReferenceSequenceNumber; | ||
@@ -58,3 +57,2 @@ private wipLocalPaths; | ||
}>; | ||
private prependOutstandingOps; | ||
recordChange(op: ISequencedDocumentMessage): void; | ||
@@ -65,2 +63,3 @@ invalidate(sequenceNumber: number): void; | ||
private readonly throwOnError; | ||
private trackingSequenceNumber; | ||
private constructor(); | ||
@@ -67,0 +66,0 @@ static createRoot(logger: ITelemetryLogger, |
@@ -115,2 +115,7 @@ "use strict"; | ||
const newOutstandingOps = await readAndParseBlob(opsBlob); | ||
if (outstandingOps.length > 0 && newOutstandingOps.length > 0) { | ||
const latestSeq = outstandingOps[outstandingOps.length - 1].sequenceNumber; | ||
const newEarliestSeq = newOutstandingOps[0].sequenceNumber; | ||
assert_1.strict(latestSeq < newEarliestSeq, `latestSeq exceeds newEarliestSeq in decodeSummary: ${latestSeq} >= ${newEarliestSeq}`); | ||
} | ||
outstandingOps = outstandingOps.concat(newOutstandingOps); | ||
@@ -172,3 +177,3 @@ } | ||
/** Undefined means created without summary */ | ||
latestSummary, initialSummary, trackingSequenceNumber = _changeSequenceNumber) { | ||
latestSummary, initialSummary) { | ||
var _a, _b; | ||
@@ -181,3 +186,2 @@ this.logger = logger; | ||
this.initialSummary = initialSummary; | ||
this.trackingSequenceNumber = trackingSequenceNumber; | ||
this.children = new Map(); | ||
@@ -189,2 +193,3 @@ this.pendingSummaries = new Map(); | ||
this.throwOnError = (_b = config.throwOnFailure, (_b !== null && _b !== void 0 ? _b : false)); | ||
this.trackingSequenceNumber = this._changeSequenceNumber; | ||
} | ||
@@ -404,3 +409,8 @@ /** | ||
if (outstandingOps.length > 0) { | ||
this.prependOutstandingOps(decodedSummary.pathParts, outstandingOps); | ||
assert_1.strict(this.latestSummary, "Should have latest summary defined if any outstanding ops found"); | ||
this.latestSummary.additionalPath = EscapedPath.createAndConcat(decodedSummary.pathParts); | ||
// Defensive: tracking number should already exceed this number. | ||
// This is probably a little excessive; can remove when stable. | ||
const newOpsLatestSeq = outstandingOps[outstandingOps.length - 1].sequenceNumber; | ||
assert_1.strict(newOpsLatestSeq <= this.trackingSequenceNumber, "When loading base summary, expected outstanding ops <= tracking sequence number"); | ||
} | ||
@@ -412,21 +422,2 @@ return { | ||
} | ||
prependOutstandingOps(pathPartsForChildren, ops) { | ||
assert_1.strict(this.latestSummary, "Should have latest summary defined to prepend outstanding ops"); | ||
if (pathPartsForChildren.length > 0) { | ||
this.latestSummary.additionalPath = EscapedPath.createAndConcat(pathPartsForChildren); | ||
} | ||
if (this.disabled) { | ||
// Do not track ops when disabled | ||
return; | ||
} | ||
if (ops.length > 0 && this.outstandingOps.length > 0) { | ||
const newOpsLatestSeq = ops[ops.length - 1].sequenceNumber; | ||
const prevOpsEarliestSeq = this.outstandingOps[0].sequenceNumber; | ||
assert_1.strict(newOpsLatestSeq < prevOpsEarliestSeq, `Out of order prepended outstanding ops: ${newOpsLatestSeq} >= ${prevOpsEarliestSeq}`); | ||
if (newOpsLatestSeq > this.trackingSequenceNumber) { | ||
this.trackingSequenceNumber = newOpsLatestSeq; | ||
} | ||
} | ||
this.outstandingOps = ops.concat(this.outstandingOps); | ||
} | ||
recordChange(op) { | ||
@@ -433,0 +424,0 @@ const lastOp = this.outstandingOps[this.outstandingOps.length - 1]; |
@@ -8,3 +8,3 @@ /*! | ||
export declare const pkgName = "@fluidframework/runtime-utils"; | ||
export declare const pkgVersion = "0.27.0"; | ||
export declare const pkgVersion = "0.27.1"; | ||
//# sourceMappingURL=packageVersion.d.ts.map |
@@ -8,3 +8,3 @@ /*! | ||
export const pkgName = "@fluidframework/runtime-utils"; | ||
export const pkgVersion = "0.27.0"; | ||
export const pkgVersion = "0.27.1"; | ||
//# sourceMappingURL=packageVersion.js.map |
@@ -31,3 +31,2 @@ /*! | ||
private readonly initialSummary?; | ||
private trackingSequenceNumber; | ||
/** | ||
@@ -40,3 +39,3 @@ * The reference sequence number of the most recent acked summary. | ||
private readonly pendingSummaries; | ||
private outstandingOps; | ||
private readonly outstandingOps; | ||
private wipReferenceSequenceNumber; | ||
@@ -58,3 +57,2 @@ private wipLocalPaths; | ||
}>; | ||
private prependOutstandingOps; | ||
recordChange(op: ISequencedDocumentMessage): void; | ||
@@ -65,2 +63,3 @@ invalidate(sequenceNumber: number): void; | ||
private readonly throwOnError; | ||
private trackingSequenceNumber; | ||
private constructor(); | ||
@@ -67,0 +66,0 @@ static createRoot(logger: ITelemetryLogger, |
@@ -113,2 +113,7 @@ /*! | ||
const newOutstandingOps = await readAndParseBlob(opsBlob); | ||
if (outstandingOps.length > 0 && newOutstandingOps.length > 0) { | ||
const latestSeq = outstandingOps[outstandingOps.length - 1].sequenceNumber; | ||
const newEarliestSeq = newOutstandingOps[0].sequenceNumber; | ||
assert(latestSeq < newEarliestSeq, `latestSeq exceeds newEarliestSeq in decodeSummary: ${latestSeq} >= ${newEarliestSeq}`); | ||
} | ||
outstandingOps = outstandingOps.concat(newOutstandingOps); | ||
@@ -170,3 +175,3 @@ } | ||
/** Undefined means created without summary */ | ||
latestSummary, initialSummary, trackingSequenceNumber = _changeSequenceNumber) { | ||
latestSummary, initialSummary) { | ||
var _a, _b; | ||
@@ -179,3 +184,2 @@ this.logger = logger; | ||
this.initialSummary = initialSummary; | ||
this.trackingSequenceNumber = trackingSequenceNumber; | ||
this.children = new Map(); | ||
@@ -187,2 +191,3 @@ this.pendingSummaries = new Map(); | ||
this.throwOnError = (_b = config.throwOnFailure, (_b !== null && _b !== void 0 ? _b : false)); | ||
this.trackingSequenceNumber = this._changeSequenceNumber; | ||
} | ||
@@ -402,3 +407,8 @@ /** | ||
if (outstandingOps.length > 0) { | ||
this.prependOutstandingOps(decodedSummary.pathParts, outstandingOps); | ||
assert(this.latestSummary, "Should have latest summary defined if any outstanding ops found"); | ||
this.latestSummary.additionalPath = EscapedPath.createAndConcat(decodedSummary.pathParts); | ||
// Defensive: tracking number should already exceed this number. | ||
// This is probably a little excessive; can remove when stable. | ||
const newOpsLatestSeq = outstandingOps[outstandingOps.length - 1].sequenceNumber; | ||
assert(newOpsLatestSeq <= this.trackingSequenceNumber, "When loading base summary, expected outstanding ops <= tracking sequence number"); | ||
} | ||
@@ -410,21 +420,2 @@ return { | ||
} | ||
prependOutstandingOps(pathPartsForChildren, ops) { | ||
assert(this.latestSummary, "Should have latest summary defined to prepend outstanding ops"); | ||
if (pathPartsForChildren.length > 0) { | ||
this.latestSummary.additionalPath = EscapedPath.createAndConcat(pathPartsForChildren); | ||
} | ||
if (this.disabled) { | ||
// Do not track ops when disabled | ||
return; | ||
} | ||
if (ops.length > 0 && this.outstandingOps.length > 0) { | ||
const newOpsLatestSeq = ops[ops.length - 1].sequenceNumber; | ||
const prevOpsEarliestSeq = this.outstandingOps[0].sequenceNumber; | ||
assert(newOpsLatestSeq < prevOpsEarliestSeq, `Out of order prepended outstanding ops: ${newOpsLatestSeq} >= ${prevOpsEarliestSeq}`); | ||
if (newOpsLatestSeq > this.trackingSequenceNumber) { | ||
this.trackingSequenceNumber = newOpsLatestSeq; | ||
} | ||
} | ||
this.outstandingOps = ops.concat(this.outstandingOps); | ||
} | ||
recordChange(op) { | ||
@@ -431,0 +422,0 @@ const lastOp = this.outstandingOps[this.outstandingOps.length - 1]; |
{ | ||
"name": "@fluidframework/runtime-utils", | ||
"version": "0.27.0", | ||
"version": "0.27.1", | ||
"description": "Collection of utility functions for Fluid Runtime", | ||
@@ -58,7 +58,7 @@ "homepage": "https://fluidframework.com", | ||
"@fluidframework/common-utils": "^0.24.0", | ||
"@fluidframework/core-interfaces": "^0.27.0", | ||
"@fluidframework/datastore-definitions": "^0.27.0", | ||
"@fluidframework/core-interfaces": "^0.27.1", | ||
"@fluidframework/datastore-definitions": "^0.27.1", | ||
"@fluidframework/protocol-base": "^0.1013.0", | ||
"@fluidframework/protocol-definitions": "^0.1013.0", | ||
"@fluidframework/runtime-definitions": "^0.27.0" | ||
"@fluidframework/runtime-definitions": "^0.27.1" | ||
}, | ||
@@ -68,3 +68,3 @@ "devDependencies": { | ||
"@fluidframework/eslint-config-fluid": "^0.19.1", | ||
"@fluidframework/mocha-test-setup": "^0.27.0", | ||
"@fluidframework/mocha-test-setup": "^0.27.1", | ||
"@microsoft/api-extractor": "^7.7.2", | ||
@@ -71,0 +71,0 @@ "@types/benchmark": "^1.0.31", |
@@ -9,2 +9,2 @@ /*! | ||
export const pkgName = "@fluidframework/runtime-utils"; | ||
export const pkgVersion = "0.27.0"; | ||
export const pkgVersion = "0.27.1"; |
@@ -149,2 +149,10 @@ /*! | ||
const newOutstandingOps = await readAndParseBlob<ISequencedDocumentMessage[]>(opsBlob); | ||
if (outstandingOps.length > 0 && newOutstandingOps.length > 0) { | ||
const latestSeq = outstandingOps[outstandingOps.length - 1].sequenceNumber; | ||
const newEarliestSeq = newOutstandingOps[0].sequenceNumber; | ||
assert( | ||
latestSeq < newEarliestSeq, | ||
`latestSeq exceeds newEarliestSeq in decodeSummary: ${latestSeq} >= ${newEarliestSeq}`, | ||
); | ||
} | ||
outstandingOps = outstandingOps.concat(newOutstandingOps); | ||
@@ -244,3 +252,3 @@ } | ||
private readonly pendingSummaries = new Map<string, SummaryNode>(); | ||
private outstandingOps: ISequencedDocumentMessage[] = []; | ||
private readonly outstandingOps: ISequencedDocumentMessage[] = []; | ||
private wipReferenceSequenceNumber: number | undefined; | ||
@@ -529,3 +537,12 @@ private wipLocalPaths: { localPath: EscapedPath, additionalPath?: EscapedPath } | undefined; | ||
if (outstandingOps.length > 0) { | ||
this.prependOutstandingOps(decodedSummary.pathParts, outstandingOps); | ||
assert(this.latestSummary, "Should have latest summary defined if any outstanding ops found"); | ||
this.latestSummary.additionalPath = EscapedPath.createAndConcat(decodedSummary.pathParts); | ||
// Defensive: tracking number should already exceed this number. | ||
// This is probably a little excessive; can remove when stable. | ||
const newOpsLatestSeq = outstandingOps[outstandingOps.length - 1].sequenceNumber; | ||
assert( | ||
newOpsLatestSeq <= this.trackingSequenceNumber, | ||
"When loading base summary, expected outstanding ops <= tracking sequence number", | ||
); | ||
} | ||
@@ -539,25 +556,2 @@ | ||
private prependOutstandingOps(pathPartsForChildren: string[], ops: ISequencedDocumentMessage[]): void { | ||
assert(this.latestSummary, "Should have latest summary defined to prepend outstanding ops"); | ||
if (pathPartsForChildren.length > 0) { | ||
this.latestSummary.additionalPath = EscapedPath.createAndConcat(pathPartsForChildren); | ||
} | ||
if (this.disabled) { | ||
// Do not track ops when disabled | ||
return; | ||
} | ||
if (ops.length > 0 && this.outstandingOps.length > 0) { | ||
const newOpsLatestSeq = ops[ops.length - 1].sequenceNumber; | ||
const prevOpsEarliestSeq = this.outstandingOps[0].sequenceNumber; | ||
assert( | ||
newOpsLatestSeq < prevOpsEarliestSeq, | ||
`Out of order prepended outstanding ops: ${newOpsLatestSeq} >= ${prevOpsEarliestSeq}`, | ||
); | ||
if (newOpsLatestSeq > this.trackingSequenceNumber) { | ||
this.trackingSequenceNumber = newOpsLatestSeq; | ||
} | ||
} | ||
this.outstandingOps = ops.concat(this.outstandingOps); | ||
} | ||
public recordChange(op: ISequencedDocumentMessage): void { | ||
@@ -591,2 +585,3 @@ const lastOp = this.outstandingOps[this.outstandingOps.length - 1]; | ||
private readonly throwOnError: boolean; | ||
private trackingSequenceNumber: number; | ||
private constructor( | ||
@@ -601,6 +596,6 @@ private readonly logger: ITelemetryLogger, | ||
private readonly initialSummary?: IInitialSummary, | ||
private trackingSequenceNumber = _changeSequenceNumber, | ||
) { | ||
this.canReuseHandle = config.canReuseHandle ?? true; | ||
this.throwOnError = config.throwOnFailure ?? false; | ||
this.trackingSequenceNumber = this._changeSequenceNumber; | ||
} | ||
@@ -607,0 +602,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
471249
5202