@fluidframework/container-runtime 2.70.0-361248 → 2.70.0-361788

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.
Files changed (57) hide show
  1. package/container-runtime.test-files.tar +0 -0
  2. package/dist/blobManager/blobManager.d.ts.map +1 -1
  3. package/dist/blobManager/blobManager.js +0 -1
  4. package/dist/blobManager/blobManager.js.map +1 -1
  5. package/dist/containerRuntime.d.ts +10 -0
  6. package/dist/containerRuntime.d.ts.map +1 -1
  7. package/dist/containerRuntime.js +37 -4
  8. package/dist/containerRuntime.js.map +1 -1
  9. package/dist/dataStoreContext.d.ts.map +1 -1
  10. package/dist/dataStoreContext.js +1 -1
  11. package/dist/dataStoreContext.js.map +1 -1
  12. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  13. package/dist/opLifecycle/outbox.js +7 -0
  14. package/dist/opLifecycle/outbox.js.map +1 -1
  15. package/dist/packageVersion.d.ts +1 -1
  16. package/dist/packageVersion.js +1 -1
  17. package/dist/packageVersion.js.map +1 -1
  18. package/dist/runtimeLayerCompatState.d.ts +4 -3
  19. package/dist/runtimeLayerCompatState.d.ts.map +1 -1
  20. package/dist/runtimeLayerCompatState.js +4 -35
  21. package/dist/runtimeLayerCompatState.js.map +1 -1
  22. package/dist/storageServiceWithAttachBlobs.d.ts +0 -36
  23. package/dist/storageServiceWithAttachBlobs.d.ts.map +1 -1
  24. package/dist/storageServiceWithAttachBlobs.js +0 -55
  25. package/dist/storageServiceWithAttachBlobs.js.map +1 -1
  26. package/lib/blobManager/blobManager.d.ts.map +1 -1
  27. package/lib/blobManager/blobManager.js +0 -1
  28. package/lib/blobManager/blobManager.js.map +1 -1
  29. package/lib/containerRuntime.d.ts +10 -0
  30. package/lib/containerRuntime.d.ts.map +1 -1
  31. package/lib/containerRuntime.js +37 -4
  32. package/lib/containerRuntime.js.map +1 -1
  33. package/lib/dataStoreContext.d.ts.map +1 -1
  34. package/lib/dataStoreContext.js +1 -1
  35. package/lib/dataStoreContext.js.map +1 -1
  36. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  37. package/lib/opLifecycle/outbox.js +7 -0
  38. package/lib/opLifecycle/outbox.js.map +1 -1
  39. package/lib/packageVersion.d.ts +1 -1
  40. package/lib/packageVersion.js +1 -1
  41. package/lib/packageVersion.js.map +1 -1
  42. package/lib/runtimeLayerCompatState.d.ts +4 -3
  43. package/lib/runtimeLayerCompatState.d.ts.map +1 -1
  44. package/lib/runtimeLayerCompatState.js +5 -36
  45. package/lib/runtimeLayerCompatState.js.map +1 -1
  46. package/lib/storageServiceWithAttachBlobs.d.ts +0 -36
  47. package/lib/storageServiceWithAttachBlobs.d.ts.map +1 -1
  48. package/lib/storageServiceWithAttachBlobs.js +0 -55
  49. package/lib/storageServiceWithAttachBlobs.js.map +1 -1
  50. package/package.json +20 -17
  51. package/src/blobManager/blobManager.ts +0 -1
  52. package/src/containerRuntime.ts +47 -8
  53. package/src/dataStoreContext.ts +1 -0
  54. package/src/opLifecycle/outbox.ts +10 -0
  55. package/src/packageVersion.ts +1 -1
  56. package/src/runtimeLayerCompatState.ts +23 -39
  57. package/src/storageServiceWithAttachBlobs.ts +0 -92
@@ -1 +1 @@
1
- {"version":3,"file":"outbox.js","sourceRoot":"","sources":["../../src/opLifecycle/outbox.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EACN,mBAAmB,EACnB,UAAU,EACV,iBAAiB,GAGjB,MAAM,0CAA0C,CAAC;AAQlD,OAAO,EACN,YAAY,EAEZ,oBAAoB,GAEpB,MAAM,mBAAmB,CAAC;AAW3B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAmDnD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAI,MAAe,EAAE,SAAiB,EAAE;IACnE,2BAA2B;IAC3B,uGAAuG;IACvG,MAAM,QAAQ,G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B,EACpB,QAAgB,EAChB,WAAsC;QAEtC,OAAO,mBAAmB,CAAC,MAAM,CAChC,eAAe,EACf,QAAQ;QACR,sBAAsB,CAAC,SAAS,EAChC;YACC,YAAY,EAAE;gBACb,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM;gBAC9B,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;gBAC5C,UAAU,EAAE,kBAAkB,CAAC,KAAK,CAAC;gBACrC,mBAAmB,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB;gBAC3D,sBAAsB,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,sBAAsB,EAAE;gBAC5E,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC;gBACzE,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB;gBAC5D,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB;gBACvD,GAAG,WAAW;aACd;SACD,CACD,CAAC;IACH,CAAC;IAED;;OAEG;IACI,mBAAmB;QAKzB,iHAAiH;QACjH,8FAA8F;QAC9F,MAAM,SAAS,GAAqB,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;QAChE,OAAO;YACN,SAAS;YACT,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE;YACtD,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE;SAClD,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IBatchMessage } from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n} from \"@fluidframework/core-interfaces\";\nimport { assert, Lazy } from \"@fluidframework/core-utils/internal\";\nimport {\n\tDataProcessingError,\n\tUsageError,\n\tcreateChildLogger,\n\ttype IFluidErrorBase,\n\ttype ITelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { ICompressionRuntimeOptions } from \"../compressionDefinitions.js\";\nimport type {\n\tPendingMessageResubmitData,\n\tPendingStateManager,\n} from \"../pendingStateManager.js\";\n\nimport {\n\tBatchManager,\n\ttype BatchSequenceNumbers,\n\tsequenceNumbersMatch,\n\ttype BatchId,\n} from \"./batchManager.js\";\nimport type {\n\tLocalBatchMessage,\n\tIBatchCheckpoint,\n\tOutboundBatchMessage,\n\tOutboundSingletonBatch,\n\tLocalBatch,\n\tOutboundBatch,\n} from \"./definitions.js\";\nimport type { OpCompressor } from \"./opCompressor.js\";\nimport type { OpGroupingManager } from \"./opGroupingManager.js\";\nimport { serializeOp } from \"./opSerialization.js\";\nimport type { OpSplitter } from \"./opSplitter.js\";\n\nexport interface IOutboxConfig {\n\treadonly compressionOptions: ICompressionRuntimeOptions;\n\t/**\n\t * The maximum size of a batch that we can send over the wire.\n\t */\n\treadonly maxBatchSizeInBytes: number;\n\t/**\n\t * If true, maybeFlushPartialBatch will flush the batch if the reference sequence number changed\n\t * since the batch started. Otherwise, it will throw in this case (apart from reentrancy which is handled elsewhere).\n\t * Once the new throw-based flow is proved in a production environment, this option will be removed.\n\t */\n\treadonly flushPartialBatches: boolean;\n}\n\nexport interface IOutboxParameters {\n\treadonly shouldSend: () => boolean;\n\treadonly pendingStateManager: PendingStateManager;\n\treadonly submitBatchFn:\n\t\t| ((batch: IBatchMessage[], referenceSequenceNumber?: number) => number)\n\t\t| undefined;\n\treadonly legacySendBatchFn: (batch: OutboundBatch) => number;\n\treadonly config: IOutboxConfig;\n\treadonly compressor: OpCompressor;\n\treadonly splitter: OpSplitter;\n\treadonly logger: ITelemetryBaseLogger;\n\treadonly groupingManager: OpGroupingManager;\n\treadonly getCurrentSequenceNumbers: () => BatchSequenceNumbers;\n\treadonly reSubmit: (message: PendingMessageResubmitData, squash: boolean) => void;\n\treadonly opReentrancy: () => boolean;\n}\n\n/**\n * Info needed to correctly resubmit a batch\n */\nexport interface BatchResubmitInfo {\n\t/**\n\t * If defined, indicates the Batch ID of the batch being resubmitted.\n\t * This must be preserved on the new batch about to be submitted so they can be correlated/deduped in case both are sent.\n\t */\n\tbatchId?: string;\n\t/**\n\t * Indicates whether or not this batch is \"staged\", meaning it should not be sent to the ordering service yet\n\t * This is important on resubmit because we may be in Staging Mode for new changes,\n\t * but resubmitting a non-staged change from before entering Staging Mode\n\t */\n\tstaged: boolean;\n}\n\n/**\n * Temporarily increase the stack limit while executing the provided action.\n * If a negative value is provided for `length`, no stack frames will be collected.\n * If Infinity is provided, all frames will be collected.\n *\n * ADO:4663 - add this to the common packages.\n *\n * @param action - action which returns an error\n * @param length - number of stack frames to collect, 50 if unspecified.\n * @returns the result of the action provided\n */\nexport function getLongStack<T>(action: () => T, length: number = 50): T {\n\t// TODO: better typing here\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\n\tconst errorObj = Error as any;\n\tif (\n\t\t/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\n\t\t// ?? is not logically equivalent when the first clause returns false.\n\t\t(\n\t\t\tObject.getOwnPropertyDescriptor(errorObj, \"stackTraceLimit\") ||\n\t\t\tObject.getOwnPropertyDescriptor(Object.getPrototypeOf(errorObj), \"stackTraceLimit\")\n\t\t)?.writable !== true\n\t\t/* eslint-enable @typescript-eslint/prefer-nullish-coalescing */\n\t) {\n\t\treturn action();\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n\tconst originalStackTraceLimit = errorObj.stackTraceLimit;\n\ttry {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\terrorObj.stackTraceLimit = length;\n\t\treturn action();\n\t} finally {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n\t\terrorObj.stackTraceLimit = originalStackTraceLimit;\n\t}\n}\n\n/**\n * Convert from local batch to outbound batch, including computing contentSizeInBytes.\n */\nexport function localBatchToOutboundBatch({\n\tstaged: _staged, // Peel this off the incoming batch, it's irrelevant (see Note below)\n\t...localBatch\n}: LocalBatch): OutboundBatch {\n\t// Note: the staged property might be misleading here, in case a pre-staging batch is resubmitted during staging mode.\n\t// It will be set to true, but the batch was not actually staged.\n\n\t// Shallow copy each message as we switch types\n\tconst outboundMessages = localBatch.messages.map<OutboundBatchMessage>(\n\t\t({ runtimeOp, ...message }) => ({\n\t\t\tcontents: serializeOp(runtimeOp),\n\t\t\t...message,\n\t\t}),\n\t);\n\tconst contentSizeInBytes = outboundMessages.reduce(\n\t\t(acc, message) => acc + (message.contents?.length ?? 0),\n\t\t0,\n\t);\n\n\t// Shallow copy the local batch, updating the messages to be outbound messages and adding contentSizeInBytes\n\tconst outboundBatch: OutboundBatch = {\n\t\t...localBatch,\n\t\tmessages: outboundMessages,\n\t\tcontentSizeInBytes,\n\t};\n\n\treturn outboundBatch;\n}\n\n/**\n * Estimated size of the stringification overhead for an op accumulated\n * from runtime to loader to the service.\n */\nconst opOverhead = 200;\n\n/**\n * Estimates the real size in bytes on the socket for a given batch. It assumes that\n * the envelope size (and the size of an empty op) is 200 bytes, taking into account\n * extra overhead from stringification.\n *\n * @remarks\n * Also content will be stringified, and that adds a lot of overhead due to a lot of escape characters.\n * Not taking it into account, as compression work should help there - compressed payload will be\n * initially stored as base64, and that requires only 2 extra escape characters.\n *\n * @param batch - the batch to inspect\n * @returns An estimate of the payload size in bytes which will be produced when the batch is sent over the wire\n */\nexport const estimateSocketSize = (batch: OutboundBatch): number => {\n\treturn batch.contentSizeInBytes + opOverhead * batch.messages.length;\n};\n\n/**\n * The Outbox collects messages submitted by the ContainerRuntime into a batch,\n * and then flushes the batch when requested.\n *\n * @remarks There are actually multiple independent batches (some are for a specific message type),\n * to support slight variation in semantics for each batch (e.g. support for rebasing or grouping).\n */\nexport class Outbox {\n\tprivate readonly logger: ITelemetryLoggerExt;\n\tprivate readonly mainBatch: BatchManager;\n\tprivate readonly blobAttachBatch: BatchManager;\n\tprivate readonly idAllocationBatch: BatchManager;\n\tprivate batchRebasesToReport = 5;\n\tprivate rebasing = false;\n\n\t/**\n\t * Track the number of ops which were detected to have a mismatched\n\t * reference sequence number, in order to self-throttle the telemetry events.\n\t *\n\t * This should be removed as part of ADO:2322\n\t */\n\tprivate readonly maxMismatchedOpsToReport = 3;\n\tprivate mismatchedOpsReported = 0;\n\n\tconstructor(private readonly params: IOutboxParameters) {\n\t\tthis.logger = createChildLogger({ logger: params.logger, namespace: \"Outbox\" });\n\n\t\tthis.mainBatch = new BatchManager({ canRebase: true });\n\t\tthis.blobAttachBatch = new BatchManager({ canRebase: true });\n\t\tthis.idAllocationBatch = new BatchManager({\n\t\t\tcanRebase: false,\n\t\t\tignoreBatchId: true,\n\t\t});\n\t}\n\n\tpublic get messageCount(): number {\n\t\treturn this.mainBatch.length + this.blobAttachBatch.length + this.idAllocationBatch.length;\n\t}\n\n\tpublic get mainBatchMessageCount(): number {\n\t\treturn this.mainBatch.length;\n\t}\n\n\tpublic get blobAttachBatchMessageCount(): number {\n\t\treturn this.blobAttachBatch.length;\n\t}\n\n\tpublic get idAllocationBatchMessageCount(): number {\n\t\treturn this.idAllocationBatch.length;\n\t}\n\n\tpublic get isEmpty(): boolean {\n\t\treturn this.messageCount === 0;\n\t}\n\n\tpublic containsUserChanges(): boolean {\n\t\treturn (\n\t\t\tthis.mainBatch.containsUserChanges() || this.blobAttachBatch.containsUserChanges()\n\t\t\t// ID Allocation ops are not user changes\n\t\t);\n\t}\n\n\t/**\n\t * Detect whether batching has been interrupted by an incoming message being processed. In this case,\n\t * we will flush the accumulated messages to account for that (if allowed) and create a new batch with the new\n\t * message as the first message. If flushing partial batch is not enabled, we will throw (except for reentrant ops).\n\t * This would indicate we expected this case to be precluded by logic elsewhere.\n\t *\n\t * @remarks To detect batch interruption, we compare both the reference sequence number\n\t * (i.e. last message processed by DeltaManager) and the client sequence number of the\n\t * last message processed by the ContainerRuntime. In the absence of op reentrancy, this\n\t * pair will remain stable during a single JS turn during which the batch is being built up.\n\t */\n\tprivate maybeFlushPartialBatch(): void {\n\t\tconst mainBatchSeqNums = this.mainBatch.sequenceNumbers;\n\t\tconst blobAttachSeqNums = this.blobAttachBatch.sequenceNumbers;\n\t\tconst idAllocSeqNums = this.idAllocationBatch.sequenceNumbers;\n\t\tassert(\n\t\t\tsequenceNumbersMatch(mainBatchSeqNums, blobAttachSeqNums) &&\n\t\t\t\tsequenceNumbersMatch(mainBatchSeqNums, idAllocSeqNums),\n\t\t\t0x58d /* Reference sequence numbers from both batches must be in sync */,\n\t\t);\n\n\t\tconst currentSequenceNumbers = this.params.getCurrentSequenceNumbers();\n\n\t\tif (\n\t\t\tsequenceNumbersMatch(mainBatchSeqNums, currentSequenceNumbers) &&\n\t\t\tsequenceNumbersMatch(blobAttachSeqNums, currentSequenceNumbers) &&\n\t\t\tsequenceNumbersMatch(idAllocSeqNums, currentSequenceNumbers)\n\t\t) {\n\t\t\t// The reference sequence numbers are stable, there is nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\t// Reference and/or Client sequence number will be advancing while processing this batch,\n\t\t// so we can't use this check to detect wrongdoing. But we will still log via telemetry.\n\t\t// This is rare, and the reentrancy will be handled during Flush.\n\t\tconst expectedDueToReentrancy = this.isContextReentrant();\n\n\t\tconst errorWrapper = new Lazy(() =>\n\t\t\tgetLongStack(() =>\n\t\t\t\tDataProcessingError.create(\n\t\t\t\t\t\"Sequence numbers advanced as if ops were processed while a batch is accumulating\",\n\t\t\t\t\t\"outboxSequenceNumberCoherencyCheck\",\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\tif (++this.mismatchedOpsReported <= this.maxMismatchedOpsToReport) {\n\t\t\tthis.logger.sendTelemetryEvent(\n\t\t\t\t{\n\t\t\t\t\t// Only log error if this is truly unexpected\n\t\t\t\t\tcategory:\n\t\t\t\t\t\texpectedDueToReentrancy || this.params.config.flushPartialBatches\n\t\t\t\t\t\t\t? \"generic\"\n\t\t\t\t\t\t\t: \"error\",\n\t\t\t\t\teventName: \"ReferenceSequenceNumberMismatch\",\n\t\t\t\t\tdetails: {\n\t\t\t\t\t\texpectedDueToReentrancy,\n\t\t\t\t\t\tmainReferenceSequenceNumber: mainBatchSeqNums.referenceSequenceNumber,\n\t\t\t\t\t\tmainClientSequenceNumber: mainBatchSeqNums.clientSequenceNumber,\n\t\t\t\t\t\tblobAttachReferenceSequenceNumber: blobAttachSeqNums.referenceSequenceNumber,\n\t\t\t\t\t\tblobAttachClientSequenceNumber: blobAttachSeqNums.clientSequenceNumber,\n\t\t\t\t\t\tcurrentReferenceSequenceNumber: currentSequenceNumbers.referenceSequenceNumber,\n\t\t\t\t\t\tcurrentClientSequenceNumber: currentSequenceNumbers.clientSequenceNumber,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\terrorWrapper.value,\n\t\t\t);\n\t\t}\n\n\t\t// If we're configured to flush partial batches, do that now and return (don't throw)\n\t\tif (this.params.config.flushPartialBatches) {\n\t\t\tthis.flushAll();\n\t\t\treturn;\n\t\t}\n\n\t\t// If we are in a reentrant context, we know this can happen without causing any harm.\n\t\tif (expectedDueToReentrancy) {\n\t\t\treturn;\n\t\t}\n\n\t\tthrow errorWrapper.value;\n\t}\n\n\tpublic submit(message: LocalBatchMessage): void {\n\t\tthis.maybeFlushPartialBatch();\n\n\t\tthis.addMessageToBatchManager(this.mainBatch, message);\n\t}\n\n\tpublic submitBlobAttach(message: LocalBatchMessage): void {\n\t\tthis.maybeFlushPartialBatch();\n\n\t\tthis.addMessageToBatchManager(this.blobAttachBatch, message);\n\t}\n\n\tpublic submitIdAllocation(message: LocalBatchMessage): void {\n\t\tthis.maybeFlushPartialBatch();\n\n\t\tthis.addMessageToBatchManager(this.idAllocationBatch, message);\n\t}\n\n\tprivate addMessageToBatchManager(\n\t\tbatchManager: BatchManager,\n\t\tmessage: LocalBatchMessage,\n\t): void {\n\t\tbatchManager.push(\n\t\t\tmessage,\n\t\t\tthis.isContextReentrant(),\n\t\t\tthis.params.getCurrentSequenceNumbers().clientSequenceNumber,\n\t\t);\n\t}\n\n\t/**\n\t * Flush all the batches to the ordering service.\n\t * This method is expected to be called at the end of a batch.\n\t *\n\t * @throws If called from a reentrant context, or if the batch being flushed is too large.\n\t * @param resubmitInfo - Key information when flushing a resubmitted batch. Undefined means this is not resubmit.\n\t */\n\tpublic flush(resubmitInfo?: BatchResubmitInfo): void {\n\t\tassert(\n\t\t\t!this.isContextReentrant(),\n\t\t\t0xb7b /* Flushing must not happen while incoming changes are being processed */,\n\t\t);\n\t\tthis.flushAll(resubmitInfo);\n\t}\n\n\tprivate flushAll(resubmitInfo?: BatchResubmitInfo): void {\n\t\tconst allBatchesEmpty =\n\t\t\tthis.idAllocationBatch.empty && this.blobAttachBatch.empty && this.mainBatch.empty;\n\t\tif (allBatchesEmpty) {\n\t\t\t// If we're resubmitting with a batchId and all batches are empty, we need to flush an empty batch.\n\t\t\t// Note that we currently resubmit one batch at a time, so on resubmit, 1 of the 2 batches will *always* be empty.\n\t\t\t// It's theoretically possible that we don't *need* to resubmit this empty batch, and in those cases, it'll safely be ignored\n\t\t\t// by the rest of the system, including remote clients.\n\t\t\t// In some cases we *must* resubmit the empty batch (to match up with a non-empty version tracked locally by a container fork), so we do it always.\n\t\t\tif (resubmitInfo?.batchId !== undefined) {\n\t\t\t\tthis.flushEmptyBatch(resubmitInfo.batchId, resubmitInfo.staged);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Don't use resubmittingBatchId for idAllocationBatch.\n\t\t// ID Allocation messages are not directly resubmitted so don't pass the resubmitInfo\n\t\tthis.flushInternal({\n\t\t\tbatchManager: this.idAllocationBatch,\n\t\t\t// Note: For now, we will never stage ID Allocation messages.\n\t\t\t// They won't contain personal info and no harm in extra allocations in case of discarding the staged changes\n\t\t});\n\t\tthis.flushInternal({\n\t\t\tbatchManager: this.blobAttachBatch,\n\t\t\tdisableGroupedBatching: true,\n\t\t\tresubmitInfo,\n\t\t});\n\t\tthis.flushInternal({\n\t\t\tbatchManager: this.mainBatch,\n\t\t\tresubmitInfo,\n\t\t});\n\t}\n\n\tprivate flushEmptyBatch(\n\t\tresubmittingBatchId: BatchId,\n\t\tresubmittingStagedBatch: boolean,\n\t): void {\n\t\tconst referenceSequenceNumber =\n\t\t\tthis.params.getCurrentSequenceNumbers().referenceSequenceNumber;\n\t\tassert(\n\t\t\treferenceSequenceNumber !== undefined,\n\t\t\t0xa01 /* reference sequence number should be defined */,\n\t\t);\n\t\tconst { outboundBatch, placeholderMessage } =\n\t\t\tthis.params.groupingManager.createEmptyGroupedBatch(\n\t\t\t\tresubmittingBatchId,\n\t\t\t\treferenceSequenceNumber,\n\t\t\t);\n\t\tlet clientSequenceNumber: number | undefined;\n\t\tif (this.params.shouldSend() && !resubmittingStagedBatch) {\n\t\t\tclientSequenceNumber = this.sendBatch(outboundBatch);\n\t\t}\n\n\t\t// Push the empty batch placeholder to the PendingStateManager\n\t\tthis.params.pendingStateManager.onFlushEmptyBatch(\n\t\t\tplaceholderMessage,\n\t\t\tclientSequenceNumber,\n\t\t\tresubmittingStagedBatch,\n\t\t);\n\t\treturn;\n\t}\n\n\tprivate flushInternal(params: {\n\t\tbatchManager: BatchManager;\n\t\tdisableGroupedBatching?: boolean;\n\t\tresubmitInfo?: BatchResubmitInfo; // undefined if not resubmitting\n\t}): void {\n\t\tconst { batchManager, disableGroupedBatching = false, resubmitInfo } = params;\n\t\tif (batchManager.empty) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst rawBatch = batchManager.popBatch(resubmitInfo?.batchId);\n\n\t\t// On resubmit we use the original batch's staged state, so these should match as well.\n\t\tconst staged = rawBatch.staged === true;\n\t\tassert(\n\t\t\tresubmitInfo === undefined || resubmitInfo.staged === staged,\n\t\t\t0xba3 /* Mismatch in staged state tracking */,\n\t\t);\n\n\t\tconst groupingEnabled =\n\t\t\t!disableGroupedBatching && this.params.groupingManager.groupedBatchingEnabled();\n\t\tif (\n\t\t\tbatchManager.options.canRebase &&\n\t\t\trawBatch.hasReentrantOps === true &&\n\t\t\tgroupingEnabled\n\t\t) {\n\t\t\tassert(!this.rebasing, 0x6fa /* A rebased batch should never have reentrant ops */);\n\t\t\t// If a batch contains reentrant ops (ops created as a result from processing another op)\n\t\t\t// it needs to be rebased so that we can ensure consistent reference sequence numbers\n\t\t\t// and eventual consistency at the DDS level.\n\t\t\t// Note: Since this is happening in the same turn the ops were originally created with,\n\t\t\t// and they haven't gone to PendingStateManager yet, we can just let them respect\n\t\t\t// ContainerRuntime.inStagingMode. So we do not plumb local 'staged' variable through here.\n\t\t\tthis.rebase(rawBatch, batchManager);\n\t\t\treturn;\n\t\t}\n\n\t\tlet clientSequenceNumber: number | undefined;\n\t\t// Did we disconnect? (i.e. is shouldSend false?)\n\t\t// If so, do nothing, as pending state manager will resubmit it correctly on reconnect.\n\t\t// Because flush() is a task that executes async (on clean stack), we can get here in disconnected state.\n\t\tif (this.params.shouldSend() && !staged) {\n\t\t\tconst virtualizedBatch = this.virtualizeBatch(rawBatch, groupingEnabled);\n\n\t\t\tclientSequenceNumber = this.sendBatch(virtualizedBatch);\n\t\t\tassert(\n\t\t\t\tclientSequenceNumber === undefined || clientSequenceNumber >= 0,\n\t\t\t\t0x9d2 /* unexpected negative clientSequenceNumber (empty batch should yield undefined) */,\n\t\t\t);\n\t\t}\n\n\t\tthis.params.pendingStateManager.onFlushBatch(\n\t\t\trawBatch.messages,\n\t\t\tclientSequenceNumber,\n\t\t\tstaged,\n\t\t\tbatchManager.options.ignoreBatchId,\n\t\t);\n\t}\n\n\t/**\n\t * Rebases a batch. All the ops in the batch are resubmitted to the runtime and\n\t * they will end up back in the same batch manager they were flushed from and subsequently flushed.\n\t *\n\t * @param rawBatch - the batch to be rebased\n\t */\n\tprivate rebase(rawBatch: LocalBatch, batchManager: BatchManager): void {\n\t\tassert(!this.rebasing, 0x6fb /* Reentrancy */);\n\t\tassert(batchManager.options.canRebase, 0x9a7 /* BatchManager does not support rebase */);\n\n\t\tthis.rebasing = true;\n\t\tconst squash = false;\n\t\tfor (const message of rawBatch.messages) {\n\t\t\tthis.params.reSubmit(\n\t\t\t\t{\n\t\t\t\t\truntimeOp: message.runtimeOp,\n\t\t\t\t\tlocalOpMetadata: message.localOpMetadata,\n\t\t\t\t\topMetadata: message.metadata,\n\t\t\t\t},\n\t\t\t\tsquash,\n\t\t\t);\n\t\t}\n\n\t\tif (this.batchRebasesToReport > 0) {\n\t\t\tthis.logger.sendTelemetryEvent(\n\t\t\t\t{\n\t\t\t\t\teventName: \"BatchRebase\",\n\t\t\t\t\tlength: rawBatch.messages.length,\n\t\t\t\t\treferenceSequenceNumber: rawBatch.referenceSequenceNumber,\n\t\t\t\t},\n\t\t\t\tnew UsageError(\"BatchRebase\"),\n\t\t\t);\n\t\t\tthis.batchRebasesToReport--;\n\t\t}\n\n\t\tthis.flushInternal({ batchManager });\n\t\tthis.rebasing = false;\n\t}\n\n\tprivate isContextReentrant(): boolean {\n\t\treturn this.params.opReentrancy() && !this.rebasing;\n\t}\n\n\t/**\n\t * As necessary and enabled, groups / compresses / chunks the given batch.\n\t *\n\t * @remarks If chunking happens, a side effect here is that 1 or more chunks are queued immediately for sending in next JS turn.\n\t *\n\t * @param localBatch - Local Batch to be virtualized - i.e. transformed into an Outbound Batch\n\t * @param groupingEnabled - If true, Grouped batching is enabled.\n\t * @returns One of the following:\n\t * - (A) The original batch (Based on what's enabled)\n\t * - (B) A grouped batch (it's a singleton batch)\n\t * - (C) A compressed singleton batch\n\t * - (D) A singleton batch containing the last chunk.\n\t */\n\tprivate virtualizeBatch(localBatch: LocalBatch, groupingEnabled: boolean): OutboundBatch {\n\t\t// Shallow copy the local batch, updating the messages to be outbound messages\n\t\tconst originalBatch = localBatchToOutboundBatch(localBatch);\n\n\t\tconst originalOrGroupedBatch = groupingEnabled\n\t\t\t? this.params.groupingManager.groupBatch(originalBatch)\n\t\t\t: originalBatch;\n\n\t\tif (originalOrGroupedBatch.messages.length !== 1) {\n\t\t\t// Compression requires a single message, so return early otherwise.\n\t\t\treturn originalOrGroupedBatch;\n\t\t}\n\n\t\t// Regardless of whether we grouped or not, we now have a batch with a single message.\n\t\t// Now proceed to compress/chunk it if necessary.\n\t\tconst singletonBatch = originalOrGroupedBatch as OutboundSingletonBatch;\n\n\t\tif (\n\t\t\tthis.params.config.compressionOptions.minimumBatchSizeInBytes >\n\t\t\t\tsingletonBatch.contentSizeInBytes ||\n\t\t\tthis.params.submitBatchFn === undefined\n\t\t) {\n\t\t\t// Nothing to do if compression is disabled, unnecessary or unsupported.\n\t\t\treturn singletonBatch;\n\t\t}\n\n\t\tconst compressedBatch = this.params.compressor.compressBatch(singletonBatch);\n\n\t\tif (this.params.splitter.isBatchChunkingEnabled) {\n\t\t\treturn compressedBatch.contentSizeInBytes <= this.params.splitter.chunkSizeInBytes\n\t\t\t\t? compressedBatch\n\t\t\t\t: this.params.splitter.splitSingletonBatchMessage(compressedBatch);\n\t\t}\n\n\t\t// We want to distinguish this \"BatchTooLarge\" case from the generic \"BatchTooLarge\" case in sendBatch\n\t\tif (compressedBatch.contentSizeInBytes >= this.params.config.maxBatchSizeInBytes) {\n\t\t\tthrow this.makeBatchTooLargeError(compressedBatch, \"CompressionInsufficient\", {\n\t\t\t\tuncompressedSizeInBytes: singletonBatch.contentSizeInBytes,\n\t\t\t});\n\t\t}\n\n\t\treturn compressedBatch;\n\t}\n\n\t/**\n\t * Sends the batch object to the container context to be sent over the wire.\n\t *\n\t * @param batch - batch to be sent\n\t * @returns the clientSequenceNumber of the start of the batch, or undefined if nothing was sent\n\t */\n\tprivate sendBatch(batch: OutboundBatch): number | undefined {\n\t\tconst length = batch.messages.length;\n\t\tif (length === 0) {\n\t\t\treturn undefined; // Nothing submitted\n\t\t}\n\n\t\tconst socketSize = estimateSocketSize(batch);\n\t\tif (socketSize >= this.params.config.maxBatchSizeInBytes) {\n\t\t\tthrow this.makeBatchTooLargeError(batch, \"CannotSend\");\n\t\t}\n\n\t\tlet clientSequenceNumber: number;\n\t\tif (this.params.submitBatchFn === undefined) {\n\t\t\t// Legacy path - supporting old loader versions. Can be removed only when LTS moves above\n\t\t\t// version that has support for batches (submitBatchFn)\n\t\t\tassert(\n\t\t\t\tbatch.messages[0].compression === undefined,\n\t\t\t\t0x5a6 /* Compression should not have happened if the loader does not support it */,\n\t\t\t);\n\n\t\t\tclientSequenceNumber = this.params.legacySendBatchFn(batch);\n\t\t} else {\n\t\t\tassert(batch.referenceSequenceNumber !== undefined, 0x58e /* Batch must not be empty */);\n\t\t\tclientSequenceNumber = this.params.submitBatchFn(\n\t\t\t\tbatch.messages.map<IBatchMessage>((message) => ({\n\t\t\t\t\tcontents: message.contents,\n\t\t\t\t\tmetadata: message.metadata,\n\t\t\t\t\tcompression: message.compression,\n\t\t\t\t\treferenceSequenceNumber: message.referenceSequenceNumber,\n\t\t\t\t})),\n\t\t\t\tbatch.referenceSequenceNumber,\n\t\t\t);\n\t\t}\n\n\t\t// Convert from clientSequenceNumber of last message in the batch to clientSequenceNumber of first message.\n\t\tclientSequenceNumber -= length - 1;\n\t\tassert(clientSequenceNumber >= 0, 0x3d0 /* clientSequenceNumber can't be negative */);\n\t\treturn clientSequenceNumber;\n\t}\n\n\tprivate makeBatchTooLargeError(\n\t\tbatch: OutboundBatch,\n\t\tcodepath: string,\n\t\tmoreDetails?: ITelemetryBaseProperties,\n\t): IFluidErrorBase {\n\t\treturn DataProcessingError.create(\n\t\t\t\"BatchTooLarge\",\n\t\t\tcodepath,\n\t\t\t/* sequencedMessage */ undefined,\n\t\t\t{\n\t\t\t\terrorDetails: {\n\t\t\t\t\topCount: batch.messages.length,\n\t\t\t\t\tcontentSizeInBytes: batch.contentSizeInBytes,\n\t\t\t\t\tsocketSize: estimateSocketSize(batch),\n\t\t\t\t\tmaxBatchSizeInBytes: this.params.config.maxBatchSizeInBytes,\n\t\t\t\t\tgroupedBatchingEnabled: this.params.groupingManager.groupedBatchingEnabled(),\n\t\t\t\t\tcompressionOptions: JSON.stringify(this.params.config.compressionOptions),\n\t\t\t\t\tchunkingEnabled: this.params.splitter.isBatchChunkingEnabled,\n\t\t\t\t\tchunkSizeInBytes: this.params.splitter.chunkSizeInBytes,\n\t\t\t\t\t...moreDetails,\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t}\n\n\t/**\n\t * Gets a checkpoint object per batch that facilitates iterating over the batch messages when rolling back.\n\t */\n\tpublic getBatchCheckpoints(): {\n\t\tmainBatch: IBatchCheckpoint;\n\t\tidAllocationBatch: IBatchCheckpoint;\n\t\tblobAttachBatch: IBatchCheckpoint;\n\t} {\n\t\t// This variable is declared with a specific type so that we have a standard import of the IBatchCheckpoint type.\n\t\t// When the type is inferred, the generated .d.ts uses a dynamic import which doesn't resolve.\n\t\tconst mainBatch: IBatchCheckpoint = this.mainBatch.checkpoint();\n\t\treturn {\n\t\t\tmainBatch,\n\t\t\tidAllocationBatch: this.idAllocationBatch.checkpoint(),\n\t\t\tblobAttachBatch: this.blobAttachBatch.checkpoint(),\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"outbox.js","sourceRoot":"","sources":["../../src/opLifecycle/outbox.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EACN,mBAAmB,EACnB,UAAU,EACV,iBAAiB,GAGjB,MAAM,0CAA0C,CAAC;AAQlD,OAAO,EACN,YAAY,EAEZ,oBAAoB,GAEpB,MAAM,mBAAmB,CAAC;AAW3B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAmDnD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAI,MAAe,EAAE,SAAiB,EAAE;IACnE,2BAA2B;IAC3B,uGAAuG;IACvG,MAAM,QAAQ,GAAG,KAAY,CAAC;IAC9B;IACC,iEA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I,MAAM,GAAG,CAAC,CAAC;QACnC,MAAM,CAAC,oBAAoB,IAAI,CAAC,EAAE,KAAK,CAAC,4CAA4C,CAAC,CAAC;QACtF,OAAO,oBAAoB,CAAC;IAC7B,CAAC;IAEO,sBAAsB,CAC7B,KAAoB,EACpB,QAAgB,EAChB,WAAsC;QAEtC,OAAO,mBAAmB,CAAC,MAAM,CAChC,eAAe,EACf,QAAQ;QACR,sBAAsB,CAAC,SAAS,EAChC;YACC,YAAY,EAAE;gBACb,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM;gBAC9B,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;gBAC5C,UAAU,EAAE,kBAAkB,CAAC,KAAK,CAAC;gBACrC,mBAAmB,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB;gBAC3D,sBAAsB,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,sBAAsB,EAAE;gBAC5E,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC;gBACzE,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB;gBAC5D,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB;gBACvD,GAAG,WAAW;aACd;SACD,CACD,CAAC;IACH,CAAC;IAED;;OAEG;IACI,mBAAmB;QAKzB,iHAAiH;QACjH,8FAA8F;QAC9F,MAAM,SAAS,GAAqB,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;QAChE,OAAO;YACN,SAAS;YACT,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE;YACtD,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE;SAClD,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IBatchMessage } from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n} from \"@fluidframework/core-interfaces\";\nimport { assert, Lazy } from \"@fluidframework/core-utils/internal\";\nimport {\n\tDataProcessingError,\n\tUsageError,\n\tcreateChildLogger,\n\ttype IFluidErrorBase,\n\ttype ITelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { ICompressionRuntimeOptions } from \"../compressionDefinitions.js\";\nimport type {\n\tPendingMessageResubmitData,\n\tPendingStateManager,\n} from \"../pendingStateManager.js\";\n\nimport {\n\tBatchManager,\n\ttype BatchSequenceNumbers,\n\tsequenceNumbersMatch,\n\ttype BatchId,\n} from \"./batchManager.js\";\nimport type {\n\tLocalBatchMessage,\n\tIBatchCheckpoint,\n\tOutboundBatchMessage,\n\tOutboundSingletonBatch,\n\tLocalBatch,\n\tOutboundBatch,\n} from \"./definitions.js\";\nimport type { OpCompressor } from \"./opCompressor.js\";\nimport type { OpGroupingManager } from \"./opGroupingManager.js\";\nimport { serializeOp } from \"./opSerialization.js\";\nimport type { OpSplitter } from \"./opSplitter.js\";\n\nexport interface IOutboxConfig {\n\treadonly compressionOptions: ICompressionRuntimeOptions;\n\t/**\n\t * The maximum size of a batch that we can send over the wire.\n\t */\n\treadonly maxBatchSizeInBytes: number;\n\t/**\n\t * If true, maybeFlushPartialBatch will flush the batch if the reference sequence number changed\n\t * since the batch started. Otherwise, it will throw in this case (apart from reentrancy which is handled elsewhere).\n\t * Once the new throw-based flow is proved in a production environment, this option will be removed.\n\t */\n\treadonly flushPartialBatches: boolean;\n}\n\nexport interface IOutboxParameters {\n\treadonly shouldSend: () => boolean;\n\treadonly pendingStateManager: PendingStateManager;\n\treadonly submitBatchFn:\n\t\t| ((batch: IBatchMessage[], referenceSequenceNumber?: number) => number)\n\t\t| undefined;\n\treadonly legacySendBatchFn: (batch: OutboundBatch) => number;\n\treadonly config: IOutboxConfig;\n\treadonly compressor: OpCompressor;\n\treadonly splitter: OpSplitter;\n\treadonly logger: ITelemetryBaseLogger;\n\treadonly groupingManager: OpGroupingManager;\n\treadonly getCurrentSequenceNumbers: () => BatchSequenceNumbers;\n\treadonly reSubmit: (message: PendingMessageResubmitData, squash: boolean) => void;\n\treadonly opReentrancy: () => boolean;\n}\n\n/**\n * Info needed to correctly resubmit a batch\n */\nexport interface BatchResubmitInfo {\n\t/**\n\t * If defined, indicates the Batch ID of the batch being resubmitted.\n\t * This must be preserved on the new batch about to be submitted so they can be correlated/deduped in case both are sent.\n\t */\n\tbatchId?: string;\n\t/**\n\t * Indicates whether or not this batch is \"staged\", meaning it should not be sent to the ordering service yet\n\t * This is important on resubmit because we may be in Staging Mode for new changes,\n\t * but resubmitting a non-staged change from before entering Staging Mode\n\t */\n\tstaged: boolean;\n}\n\n/**\n * Temporarily increase the stack limit while executing the provided action.\n * If a negative value is provided for `length`, no stack frames will be collected.\n * If Infinity is provided, all frames will be collected.\n *\n * ADO:4663 - add this to the common packages.\n *\n * @param action - action which returns an error\n * @param length - number of stack frames to collect, 50 if unspecified.\n * @returns the result of the action provided\n */\nexport function getLongStack<T>(action: () => T, length: number = 50): T {\n\t// TODO: better typing here\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\n\tconst errorObj = Error as any;\n\tif (\n\t\t/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\n\t\t// ?? is not logically equivalent when the first clause returns false.\n\t\t(\n\t\t\tObject.getOwnPropertyDescriptor(errorObj, \"stackTraceLimit\") ||\n\t\t\tObject.getOwnPropertyDescriptor(Object.getPrototypeOf(errorObj), \"stackTraceLimit\")\n\t\t)?.writable !== true\n\t\t/* eslint-enable @typescript-eslint/prefer-nullish-coalescing */\n\t) {\n\t\treturn action();\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n\tconst originalStackTraceLimit = errorObj.stackTraceLimit;\n\ttry {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\terrorObj.stackTraceLimit = length;\n\t\treturn action();\n\t} finally {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n\t\terrorObj.stackTraceLimit = originalStackTraceLimit;\n\t}\n}\n\n/**\n * Convert from local batch to outbound batch, including computing contentSizeInBytes.\n */\nexport function localBatchToOutboundBatch({\n\tstaged: _staged, // Peel this off the incoming batch, it's irrelevant (see Note below)\n\t...localBatch\n}: LocalBatch): OutboundBatch {\n\t// Note: the staged property might be misleading here, in case a pre-staging batch is resubmitted during staging mode.\n\t// It will be set to true, but the batch was not actually staged.\n\n\t// Shallow copy each message as we switch types\n\tconst outboundMessages = localBatch.messages.map<OutboundBatchMessage>(\n\t\t({ runtimeOp, ...message }) => ({\n\t\t\tcontents: serializeOp(runtimeOp),\n\t\t\t...message,\n\t\t}),\n\t);\n\tconst contentSizeInBytes = outboundMessages.reduce(\n\t\t(acc, message) => acc + (message.contents?.length ?? 0),\n\t\t0,\n\t);\n\n\t// Shallow copy the local batch, updating the messages to be outbound messages and adding contentSizeInBytes\n\tconst outboundBatch: OutboundBatch = {\n\t\t...localBatch,\n\t\tmessages: outboundMessages,\n\t\tcontentSizeInBytes,\n\t};\n\n\treturn outboundBatch;\n}\n\n/**\n * Estimated size of the stringification overhead for an op accumulated\n * from runtime to loader to the service.\n */\nconst opOverhead = 200;\n\n/**\n * Estimates the real size in bytes on the socket for a given batch. It assumes that\n * the envelope size (and the size of an empty op) is 200 bytes, taking into account\n * extra overhead from stringification.\n *\n * @remarks\n * Also content will be stringified, and that adds a lot of overhead due to a lot of escape characters.\n * Not taking it into account, as compression work should help there - compressed payload will be\n * initially stored as base64, and that requires only 2 extra escape characters.\n *\n * @param batch - the batch to inspect\n * @returns An estimate of the payload size in bytes which will be produced when the batch is sent over the wire\n */\nexport const estimateSocketSize = (batch: OutboundBatch): number => {\n\treturn batch.contentSizeInBytes + opOverhead * batch.messages.length;\n};\n\n/**\n * The Outbox collects messages submitted by the ContainerRuntime into a batch,\n * and then flushes the batch when requested.\n *\n * @remarks There are actually multiple independent batches (some are for a specific message type),\n * to support slight variation in semantics for each batch (e.g. support for rebasing or grouping).\n */\nexport class Outbox {\n\tprivate readonly logger: ITelemetryLoggerExt;\n\tprivate readonly mainBatch: BatchManager;\n\tprivate readonly blobAttachBatch: BatchManager;\n\tprivate readonly idAllocationBatch: BatchManager;\n\tprivate batchRebasesToReport = 5;\n\tprivate rebasing = false;\n\n\t/**\n\t * Track the number of ops which were detected to have a mismatched\n\t * reference sequence number, in order to self-throttle the telemetry events.\n\t *\n\t * This should be removed as part of ADO:2322\n\t */\n\tprivate readonly maxMismatchedOpsToReport = 3;\n\tprivate mismatchedOpsReported = 0;\n\n\tconstructor(private readonly params: IOutboxParameters) {\n\t\tthis.logger = createChildLogger({ logger: params.logger, namespace: \"Outbox\" });\n\n\t\tthis.mainBatch = new BatchManager({ canRebase: true });\n\t\tthis.blobAttachBatch = new BatchManager({ canRebase: true });\n\t\tthis.idAllocationBatch = new BatchManager({\n\t\t\tcanRebase: false,\n\t\t\tignoreBatchId: true,\n\t\t});\n\t}\n\n\tpublic get messageCount(): number {\n\t\treturn this.mainBatch.length + this.blobAttachBatch.length + this.idAllocationBatch.length;\n\t}\n\n\tpublic get mainBatchMessageCount(): number {\n\t\treturn this.mainBatch.length;\n\t}\n\n\tpublic get blobAttachBatchMessageCount(): number {\n\t\treturn this.blobAttachBatch.length;\n\t}\n\n\tpublic get idAllocationBatchMessageCount(): number {\n\t\treturn this.idAllocationBatch.length;\n\t}\n\n\tpublic get isEmpty(): boolean {\n\t\treturn this.messageCount === 0;\n\t}\n\n\tpublic containsUserChanges(): boolean {\n\t\treturn (\n\t\t\tthis.mainBatch.containsUserChanges() || this.blobAttachBatch.containsUserChanges()\n\t\t\t// ID Allocation ops are not user changes\n\t\t);\n\t}\n\n\t/**\n\t * Detect whether batching has been interrupted by an incoming message being processed. In this case,\n\t * we will flush the accumulated messages to account for that (if allowed) and create a new batch with the new\n\t * message as the first message. If flushing partial batch is not enabled, we will throw (except for reentrant ops).\n\t * This would indicate we expected this case to be precluded by logic elsewhere.\n\t *\n\t * @remarks To detect batch interruption, we compare both the reference sequence number\n\t * (i.e. last message processed by DeltaManager) and the client sequence number of the\n\t * last message processed by the ContainerRuntime. In the absence of op reentrancy, this\n\t * pair will remain stable during a single JS turn during which the batch is being built up.\n\t */\n\tprivate maybeFlushPartialBatch(): void {\n\t\tconst mainBatchSeqNums = this.mainBatch.sequenceNumbers;\n\t\tconst blobAttachSeqNums = this.blobAttachBatch.sequenceNumbers;\n\t\tconst idAllocSeqNums = this.idAllocationBatch.sequenceNumbers;\n\t\tassert(\n\t\t\tsequenceNumbersMatch(mainBatchSeqNums, blobAttachSeqNums) &&\n\t\t\t\tsequenceNumbersMatch(mainBatchSeqNums, idAllocSeqNums),\n\t\t\t0x58d /* Reference sequence numbers from both batches must be in sync */,\n\t\t);\n\n\t\tconst currentSequenceNumbers = this.params.getCurrentSequenceNumbers();\n\n\t\tif (\n\t\t\tsequenceNumbersMatch(mainBatchSeqNums, currentSequenceNumbers) &&\n\t\t\tsequenceNumbersMatch(blobAttachSeqNums, currentSequenceNumbers) &&\n\t\t\tsequenceNumbersMatch(idAllocSeqNums, currentSequenceNumbers)\n\t\t) {\n\t\t\t// The reference sequence numbers are stable, there is nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\t// Reference and/or Client sequence number will be advancing while processing this batch,\n\t\t// so we can't use this check to detect wrongdoing. But we will still log via telemetry.\n\t\t// This is rare, and the reentrancy will be handled during Flush.\n\t\tconst expectedDueToReentrancy = this.isContextReentrant();\n\n\t\tconst errorWrapper = new Lazy(() =>\n\t\t\tgetLongStack(() =>\n\t\t\t\tDataProcessingError.create(\n\t\t\t\t\t\"Sequence numbers advanced as if ops were processed while a batch is accumulating\",\n\t\t\t\t\t\"outboxSequenceNumberCoherencyCheck\",\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\tif (++this.mismatchedOpsReported <= this.maxMismatchedOpsToReport) {\n\t\t\tthis.logger.sendTelemetryEvent(\n\t\t\t\t{\n\t\t\t\t\t// Only log error if this is truly unexpected\n\t\t\t\t\tcategory:\n\t\t\t\t\t\texpectedDueToReentrancy || this.params.config.flushPartialBatches\n\t\t\t\t\t\t\t? \"generic\"\n\t\t\t\t\t\t\t: \"error\",\n\t\t\t\t\teventName: \"ReferenceSequenceNumberMismatch\",\n\t\t\t\t\tdetails: {\n\t\t\t\t\t\texpectedDueToReentrancy,\n\t\t\t\t\t\tmainReferenceSequenceNumber: mainBatchSeqNums.referenceSequenceNumber,\n\t\t\t\t\t\tmainClientSequenceNumber: mainBatchSeqNums.clientSequenceNumber,\n\t\t\t\t\t\tblobAttachReferenceSequenceNumber: blobAttachSeqNums.referenceSequenceNumber,\n\t\t\t\t\t\tblobAttachClientSequenceNumber: blobAttachSeqNums.clientSequenceNumber,\n\t\t\t\t\t\tcurrentReferenceSequenceNumber: currentSequenceNumbers.referenceSequenceNumber,\n\t\t\t\t\t\tcurrentClientSequenceNumber: currentSequenceNumbers.clientSequenceNumber,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\terrorWrapper.value,\n\t\t\t);\n\t\t}\n\n\t\t// If we're configured to flush partial batches, do that now and return (don't throw)\n\t\tif (this.params.config.flushPartialBatches) {\n\t\t\tthis.flushAll();\n\t\t\treturn;\n\t\t}\n\n\t\t// If we are in a reentrant context, we know this can happen without causing any harm.\n\t\tif (expectedDueToReentrancy) {\n\t\t\treturn;\n\t\t}\n\n\t\tthrow errorWrapper.value;\n\t}\n\n\tpublic submit(message: LocalBatchMessage): void {\n\t\tthis.maybeFlushPartialBatch();\n\n\t\tthis.addMessageToBatchManager(this.mainBatch, message);\n\t}\n\n\tpublic submitBlobAttach(message: LocalBatchMessage): void {\n\t\tthis.maybeFlushPartialBatch();\n\n\t\tthis.addMessageToBatchManager(this.blobAttachBatch, message);\n\t}\n\n\tpublic submitIdAllocation(message: LocalBatchMessage): void {\n\t\tthis.maybeFlushPartialBatch();\n\n\t\tthis.addMessageToBatchManager(this.idAllocationBatch, message);\n\t}\n\n\tprivate addMessageToBatchManager(\n\t\tbatchManager: BatchManager,\n\t\tmessage: LocalBatchMessage,\n\t): void {\n\t\tbatchManager.push(\n\t\t\tmessage,\n\t\t\tthis.isContextReentrant(),\n\t\t\tthis.params.getCurrentSequenceNumbers().clientSequenceNumber,\n\t\t);\n\t}\n\n\t/**\n\t * Flush all the batches to the ordering service.\n\t * This method is expected to be called at the end of a batch.\n\t *\n\t * @throws If called from a reentrant context, or if the batch being flushed is too large.\n\t * @param resubmitInfo - Key information when flushing a resubmitted batch. Undefined means this is not resubmit.\n\t */\n\tpublic flush(resubmitInfo?: BatchResubmitInfo): void {\n\t\t// We have nothing to flush if all batchManagers are empty, and we we're not needing to resubmit an empty batch placeholder\n\t\tif (\n\t\t\tthis.idAllocationBatch.empty &&\n\t\t\tthis.blobAttachBatch.empty &&\n\t\t\tthis.mainBatch.empty &&\n\t\t\tresubmitInfo?.batchId === undefined\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tassert(\n\t\t\t!this.isContextReentrant(),\n\t\t\t0xb7b /* Flushing must not happen while incoming changes are being processed */,\n\t\t);\n\t\tthis.flushAll(resubmitInfo);\n\t}\n\n\tprivate flushAll(resubmitInfo?: BatchResubmitInfo): void {\n\t\tconst allBatchesEmpty =\n\t\t\tthis.idAllocationBatch.empty && this.blobAttachBatch.empty && this.mainBatch.empty;\n\t\tif (allBatchesEmpty) {\n\t\t\t// If we're resubmitting with a batchId and all batches are empty, we need to flush an empty batch.\n\t\t\t// Note that we currently resubmit one batch at a time, so on resubmit, 1 of the 2 batches will *always* be empty.\n\t\t\t// It's theoretically possible that we don't *need* to resubmit this empty batch, and in those cases, it'll safely be ignored\n\t\t\t// by the rest of the system, including remote clients.\n\t\t\t// In some cases we *must* resubmit the empty batch (to match up with a non-empty version tracked locally by a container fork), so we do it always.\n\t\t\tif (resubmitInfo?.batchId !== undefined) {\n\t\t\t\tthis.flushEmptyBatch(resubmitInfo.batchId, resubmitInfo.staged);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Don't use resubmittingBatchId for idAllocationBatch.\n\t\t// ID Allocation messages are not directly resubmitted so don't pass the resubmitInfo\n\t\tthis.flushInternal({\n\t\t\tbatchManager: this.idAllocationBatch,\n\t\t\t// Note: For now, we will never stage ID Allocation messages.\n\t\t\t// They won't contain personal info and no harm in extra allocations in case of discarding the staged changes\n\t\t});\n\t\tthis.flushInternal({\n\t\t\tbatchManager: this.blobAttachBatch,\n\t\t\tdisableGroupedBatching: true,\n\t\t\tresubmitInfo,\n\t\t});\n\t\tthis.flushInternal({\n\t\t\tbatchManager: this.mainBatch,\n\t\t\tresubmitInfo,\n\t\t});\n\t}\n\n\tprivate flushEmptyBatch(\n\t\tresubmittingBatchId: BatchId,\n\t\tresubmittingStagedBatch: boolean,\n\t): void {\n\t\tconst referenceSequenceNumber =\n\t\t\tthis.params.getCurrentSequenceNumbers().referenceSequenceNumber;\n\t\tassert(\n\t\t\treferenceSequenceNumber !== undefined,\n\t\t\t0xa01 /* reference sequence number should be defined */,\n\t\t);\n\t\tconst { outboundBatch, placeholderMessage } =\n\t\t\tthis.params.groupingManager.createEmptyGroupedBatch(\n\t\t\t\tresubmittingBatchId,\n\t\t\t\treferenceSequenceNumber,\n\t\t\t);\n\t\tlet clientSequenceNumber: number | undefined;\n\t\tif (this.params.shouldSend() && !resubmittingStagedBatch) {\n\t\t\tclientSequenceNumber = this.sendBatch(outboundBatch);\n\t\t}\n\n\t\t// Push the empty batch placeholder to the PendingStateManager\n\t\tthis.params.pendingStateManager.onFlushEmptyBatch(\n\t\t\tplaceholderMessage,\n\t\t\tclientSequenceNumber,\n\t\t\tresubmittingStagedBatch,\n\t\t);\n\t\treturn;\n\t}\n\n\tprivate flushInternal(params: {\n\t\tbatchManager: BatchManager;\n\t\tdisableGroupedBatching?: boolean;\n\t\tresubmitInfo?: BatchResubmitInfo; // undefined if not resubmitting\n\t}): void {\n\t\tconst { batchManager, disableGroupedBatching = false, resubmitInfo } = params;\n\t\tif (batchManager.empty) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst rawBatch = batchManager.popBatch(resubmitInfo?.batchId);\n\n\t\t// On resubmit we use the original batch's staged state, so these should match as well.\n\t\tconst staged = rawBatch.staged === true;\n\t\tassert(\n\t\t\tresubmitInfo === undefined || resubmitInfo.staged === staged,\n\t\t\t0xba3 /* Mismatch in staged state tracking */,\n\t\t);\n\n\t\tconst groupingEnabled =\n\t\t\t!disableGroupedBatching && this.params.groupingManager.groupedBatchingEnabled();\n\t\tif (\n\t\t\tbatchManager.options.canRebase &&\n\t\t\trawBatch.hasReentrantOps === true &&\n\t\t\tgroupingEnabled\n\t\t) {\n\t\t\tassert(!this.rebasing, 0x6fa /* A rebased batch should never have reentrant ops */);\n\t\t\t// If a batch contains reentrant ops (ops created as a result from processing another op)\n\t\t\t// it needs to be rebased so that we can ensure consistent reference sequence numbers\n\t\t\t// and eventual consistency at the DDS level.\n\t\t\t// Note: Since this is happening in the same turn the ops were originally created with,\n\t\t\t// and they haven't gone to PendingStateManager yet, we can just let them respect\n\t\t\t// ContainerRuntime.inStagingMode. So we do not plumb local 'staged' variable through here.\n\t\t\tthis.rebase(rawBatch, batchManager);\n\t\t\treturn;\n\t\t}\n\n\t\tlet clientSequenceNumber: number | undefined;\n\t\t// Did we disconnect? (i.e. is shouldSend false?)\n\t\t// If so, do nothing, as pending state manager will resubmit it correctly on reconnect.\n\t\t// Because flush() is a task that executes async (on clean stack), we can get here in disconnected state.\n\t\tif (this.params.shouldSend() && !staged) {\n\t\t\tconst virtualizedBatch = this.virtualizeBatch(rawBatch, groupingEnabled);\n\n\t\t\tclientSequenceNumber = this.sendBatch(virtualizedBatch);\n\t\t\tassert(\n\t\t\t\tclientSequenceNumber === undefined || clientSequenceNumber >= 0,\n\t\t\t\t0x9d2 /* unexpected negative clientSequenceNumber (empty batch should yield undefined) */,\n\t\t\t);\n\t\t}\n\n\t\tthis.params.pendingStateManager.onFlushBatch(\n\t\t\trawBatch.messages,\n\t\t\tclientSequenceNumber,\n\t\t\tstaged,\n\t\t\tbatchManager.options.ignoreBatchId,\n\t\t);\n\t}\n\n\t/**\n\t * Rebases a batch. All the ops in the batch are resubmitted to the runtime and\n\t * they will end up back in the same batch manager they were flushed from and subsequently flushed.\n\t *\n\t * @param rawBatch - the batch to be rebased\n\t */\n\tprivate rebase(rawBatch: LocalBatch, batchManager: BatchManager): void {\n\t\tassert(!this.rebasing, 0x6fb /* Reentrancy */);\n\t\tassert(batchManager.options.canRebase, 0x9a7 /* BatchManager does not support rebase */);\n\n\t\tthis.rebasing = true;\n\t\tconst squash = false;\n\t\tfor (const message of rawBatch.messages) {\n\t\t\tthis.params.reSubmit(\n\t\t\t\t{\n\t\t\t\t\truntimeOp: message.runtimeOp,\n\t\t\t\t\tlocalOpMetadata: message.localOpMetadata,\n\t\t\t\t\topMetadata: message.metadata,\n\t\t\t\t},\n\t\t\t\tsquash,\n\t\t\t);\n\t\t}\n\n\t\tif (this.batchRebasesToReport > 0) {\n\t\t\tthis.logger.sendTelemetryEvent(\n\t\t\t\t{\n\t\t\t\t\teventName: \"BatchRebase\",\n\t\t\t\t\tlength: rawBatch.messages.length,\n\t\t\t\t\treferenceSequenceNumber: rawBatch.referenceSequenceNumber,\n\t\t\t\t},\n\t\t\t\tnew UsageError(\"BatchRebase\"),\n\t\t\t);\n\t\t\tthis.batchRebasesToReport--;\n\t\t}\n\n\t\tthis.flushInternal({ batchManager });\n\t\tthis.rebasing = false;\n\t}\n\n\tprivate isContextReentrant(): boolean {\n\t\treturn this.params.opReentrancy() && !this.rebasing;\n\t}\n\n\t/**\n\t * As necessary and enabled, groups / compresses / chunks the given batch.\n\t *\n\t * @remarks If chunking happens, a side effect here is that 1 or more chunks are queued immediately for sending in next JS turn.\n\t *\n\t * @param localBatch - Local Batch to be virtualized - i.e. transformed into an Outbound Batch\n\t * @param groupingEnabled - If true, Grouped batching is enabled.\n\t * @returns One of the following:\n\t * - (A) The original batch (Based on what's enabled)\n\t * - (B) A grouped batch (it's a singleton batch)\n\t * - (C) A compressed singleton batch\n\t * - (D) A singleton batch containing the last chunk.\n\t */\n\tprivate virtualizeBatch(localBatch: LocalBatch, groupingEnabled: boolean): OutboundBatch {\n\t\t// Shallow copy the local batch, updating the messages to be outbound messages\n\t\tconst originalBatch = localBatchToOutboundBatch(localBatch);\n\n\t\tconst originalOrGroupedBatch = groupingEnabled\n\t\t\t? this.params.groupingManager.groupBatch(originalBatch)\n\t\t\t: originalBatch;\n\n\t\tif (originalOrGroupedBatch.messages.length !== 1) {\n\t\t\t// Compression requires a single message, so return early otherwise.\n\t\t\treturn originalOrGroupedBatch;\n\t\t}\n\n\t\t// Regardless of whether we grouped or not, we now have a batch with a single message.\n\t\t// Now proceed to compress/chunk it if necessary.\n\t\tconst singletonBatch = originalOrGroupedBatch as OutboundSingletonBatch;\n\n\t\tif (\n\t\t\tthis.params.config.compressionOptions.minimumBatchSizeInBytes >\n\t\t\t\tsingletonBatch.contentSizeInBytes ||\n\t\t\tthis.params.submitBatchFn === undefined\n\t\t) {\n\t\t\t// Nothing to do if compression is disabled, unnecessary or unsupported.\n\t\t\treturn singletonBatch;\n\t\t}\n\n\t\tconst compressedBatch = this.params.compressor.compressBatch(singletonBatch);\n\n\t\tif (this.params.splitter.isBatchChunkingEnabled) {\n\t\t\treturn compressedBatch.contentSizeInBytes <= this.params.splitter.chunkSizeInBytes\n\t\t\t\t? compressedBatch\n\t\t\t\t: this.params.splitter.splitSingletonBatchMessage(compressedBatch);\n\t\t}\n\n\t\t// We want to distinguish this \"BatchTooLarge\" case from the generic \"BatchTooLarge\" case in sendBatch\n\t\tif (compressedBatch.contentSizeInBytes >= this.params.config.maxBatchSizeInBytes) {\n\t\t\tthrow this.makeBatchTooLargeError(compressedBatch, \"CompressionInsufficient\", {\n\t\t\t\tuncompressedSizeInBytes: singletonBatch.contentSizeInBytes,\n\t\t\t});\n\t\t}\n\n\t\treturn compressedBatch;\n\t}\n\n\t/**\n\t * Sends the batch object to the container context to be sent over the wire.\n\t *\n\t * @param batch - batch to be sent\n\t * @returns the clientSequenceNumber of the start of the batch, or undefined if nothing was sent\n\t */\n\tprivate sendBatch(batch: OutboundBatch): number | undefined {\n\t\tconst length = batch.messages.length;\n\t\tif (length === 0) {\n\t\t\treturn undefined; // Nothing submitted\n\t\t}\n\n\t\tconst socketSize = estimateSocketSize(batch);\n\t\tif (socketSize >= this.params.config.maxBatchSizeInBytes) {\n\t\t\tthrow this.makeBatchTooLargeError(batch, \"CannotSend\");\n\t\t}\n\n\t\tlet clientSequenceNumber: number;\n\t\tif (this.params.submitBatchFn === undefined) {\n\t\t\t// Legacy path - supporting old loader versions. Can be removed only when LTS moves above\n\t\t\t// version that has support for batches (submitBatchFn)\n\t\t\tassert(\n\t\t\t\tbatch.messages[0].compression === undefined,\n\t\t\t\t0x5a6 /* Compression should not have happened if the loader does not support it */,\n\t\t\t);\n\n\t\t\tclientSequenceNumber = this.params.legacySendBatchFn(batch);\n\t\t} else {\n\t\t\tassert(batch.referenceSequenceNumber !== undefined, 0x58e /* Batch must not be empty */);\n\t\t\tclientSequenceNumber = this.params.submitBatchFn(\n\t\t\t\tbatch.messages.map<IBatchMessage>((message) => ({\n\t\t\t\t\tcontents: message.contents,\n\t\t\t\t\tmetadata: message.metadata,\n\t\t\t\t\tcompression: message.compression,\n\t\t\t\t\treferenceSequenceNumber: message.referenceSequenceNumber,\n\t\t\t\t})),\n\t\t\t\tbatch.referenceSequenceNumber,\n\t\t\t);\n\t\t}\n\n\t\t// Convert from clientSequenceNumber of last message in the batch to clientSequenceNumber of first message.\n\t\tclientSequenceNumber -= length - 1;\n\t\tassert(clientSequenceNumber >= 0, 0x3d0 /* clientSequenceNumber can't be negative */);\n\t\treturn clientSequenceNumber;\n\t}\n\n\tprivate makeBatchTooLargeError(\n\t\tbatch: OutboundBatch,\n\t\tcodepath: string,\n\t\tmoreDetails?: ITelemetryBaseProperties,\n\t): IFluidErrorBase {\n\t\treturn DataProcessingError.create(\n\t\t\t\"BatchTooLarge\",\n\t\t\tcodepath,\n\t\t\t/* sequencedMessage */ undefined,\n\t\t\t{\n\t\t\t\terrorDetails: {\n\t\t\t\t\topCount: batch.messages.length,\n\t\t\t\t\tcontentSizeInBytes: batch.contentSizeInBytes,\n\t\t\t\t\tsocketSize: estimateSocketSize(batch),\n\t\t\t\t\tmaxBatchSizeInBytes: this.params.config.maxBatchSizeInBytes,\n\t\t\t\t\tgroupedBatchingEnabled: this.params.groupingManager.groupedBatchingEnabled(),\n\t\t\t\t\tcompressionOptions: JSON.stringify(this.params.config.compressionOptions),\n\t\t\t\t\tchunkingEnabled: this.params.splitter.isBatchChunkingEnabled,\n\t\t\t\t\tchunkSizeInBytes: this.params.splitter.chunkSizeInBytes,\n\t\t\t\t\t...moreDetails,\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t}\n\n\t/**\n\t * Gets a checkpoint object per batch that facilitates iterating over the batch messages when rolling back.\n\t */\n\tpublic getBatchCheckpoints(): {\n\t\tmainBatch: IBatchCheckpoint;\n\t\tidAllocationBatch: IBatchCheckpoint;\n\t\tblobAttachBatch: IBatchCheckpoint;\n\t} {\n\t\t// This variable is declared with a specific type so that we have a standard import of the IBatchCheckpoint type.\n\t\t// When the type is inferred, the generated .d.ts uses a dynamic import which doesn't resolve.\n\t\tconst mainBatch: IBatchCheckpoint = this.mainBatch.checkpoint();\n\t\treturn {\n\t\t\tmainBatch,\n\t\t\tidAllocationBatch: this.idAllocationBatch.checkpoint(),\n\t\t\tblobAttachBatch: this.blobAttachBatch.checkpoint(),\n\t\t};\n\t}\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/container-runtime";
8
- export declare const pkgVersion = "2.70.0-361248";
8
+ export declare const pkgVersion = "2.70.0-361788";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/container-runtime";
8
- export const pkgVersion = "2.70.0-361248";
8
+ export const pkgVersion = "2.70.0-361788";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.70.0-361248\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.70.0-361788\";\n"]}
@@ -2,8 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type ILayerCompatDetails, type ILayerCompatSupportRequirements } from "@fluid-internal/client-utils";
5
+ import type { ILayerCompatDetails, ILayerCompatSupportRequirements } from "@fluid-internal/client-utils";
6
6
  import type { ICriticalContainerError } from "@fluidframework/container-definitions";
7
+ import { type ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
7
8
  /**
8
9
  * The core compatibility details of the Runtime layer that is the same across all layer boundaries.
9
10
  * @internal
@@ -42,10 +43,10 @@ export declare const dataStoreSupportRequirementsForRuntime: ILayerCompatSupport
42
43
  * Validates that the Loader layer is compatible with this Runtime.
43
44
  * @internal
44
45
  */
45
- export declare function validateLoaderCompatibility(maybeLoaderCompatDetailsForRuntime: ILayerCompatDetails | undefined, disposeFn: (error?: ICriticalContainerError) => void): void;
46
+ export declare function validateLoaderCompatibility(maybeLoaderCompatDetailsForRuntime: ILayerCompatDetails | undefined, disposeFn: (error?: ICriticalContainerError) => void, logger: ITelemetryLoggerExt): void;
46
47
  /**
47
48
  * Validates that the DataStore layer is compatible with this Runtime.
48
49
  * @internal
49
50
  */
50
- export declare function validateDatastoreCompatibility(maybeDataStoreCompatDetails: ILayerCompatDetails | undefined, disposeFn: () => void): void;
51
+ export declare function validateDatastoreCompatibility(maybeDataStoreCompatDetailsForRuntime: ILayerCompatDetails | undefined, disposeFn: () => void, logger: ITelemetryLoggerExt): void;
51
52
  //# sourceMappingURL=runtimeLayerCompatState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeLayerCompatState.d.ts","sourceRoot":"","sources":["../src/runtimeLayerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AASrF;;;GAGG;AACH,eAAO,MAAM,wBAAwB;IACpC;;OAEG;;IAEH;;OAEG;;CAEH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,mBAM3C,CAAC;AAEF;;;GAG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AE,mBAAmB,GACzB,IAAI,CAUN;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC7C,qCAAqC,EAAE,mBAAmB,GAAG,SAAS,EACtE,SAAS,EAAE,MAAM,IAAI,EACrB,MAAM,EAAE,mBAAmB,GACzB,IAAI,CAUN"}
@@ -2,9 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { checkLayerCompatibility, } from "@fluid-internal/client-utils";
6
5
  import { encodeHandlesInContainerRuntime, notifiesReadOnlyState, } from "@fluidframework/runtime-definitions/internal";
7
- import { UsageError } from "@fluidframework/telemetry-utils/internal";
6
+ import { validateLayerCompatibility, } from "@fluidframework/telemetry-utils/internal";
8
7
  import { pkgVersion } from "./packageVersion.js";
9
8
  /**
10
9
  * The core compatibility details of the Runtime layer that is the same across all layer boundaries.
@@ -76,44 +75,14 @@ export const dataStoreSupportRequirementsForRuntime = {
76
75
  * Validates that the Loader layer is compatible with this Runtime.
77
76
  * @internal
78
77
  */
79
- export function validateLoaderCompatibility(maybeLoaderCompatDetailsForRuntime, disposeFn) {
80
- const layerCheckResult = checkLayerCompatibility(loaderSupportRequirementsForRuntime, maybeLoaderCompatDetailsForRuntime);
81
- if (!layerCheckResult.isCompatible) {
82
- const error = new UsageError("Runtime is not compatible with Loader", {
83
- errorDetails: JSON.stringify({
84
- runtimeVersion: runtimeCoreCompatDetails.pkgVersion,
85
- loaderVersion: maybeLoaderCompatDetailsForRuntime?.pkgVersion,
86
- runtimeGeneration: runtimeCoreCompatDetails.generation,
87
- loaderGeneration: maybeLoaderCompatDetailsForRuntime?.generation,
88
- minSupportedGeneration: loaderSupportRequirementsForRuntime.minSupportedGeneration,
89
- isGenerationCompatible: layerCheckResult.isGenerationCompatible,
90
- unsupportedFeatures: layerCheckResult.unsupportedFeatures,
91
- }),
92
- });
93
- disposeFn(error);
94
- throw error;
95
- }
78
+ export function validateLoaderCompatibility(maybeLoaderCompatDetailsForRuntime, disposeFn, logger) {
79
+ validateLayerCompatibility("runtime", "loader", runtimeCompatDetailsForLoader, loaderSupportRequirementsForRuntime, maybeLoaderCompatDetailsForRuntime, disposeFn, logger);
96
80
  }
97
81
  /**
98
82
  * Validates that the DataStore layer is compatible with this Runtime.
99
83
  * @internal
100
84
  */
101
- export function validateDatastoreCompatibility(maybeDataStoreCompatDetails, disposeFn) {
102
- const layerCheckResult = checkLayerCompatibility(dataStoreSupportRequirementsForRuntime, maybeDataStoreCompatDetails);
103
- if (!layerCheckResult.isCompatible) {
104
- const error = new UsageError("Runtime is not compatible with DataStore", {
105
- errorDetails: JSON.stringify({
106
- runtimeVersion: runtimeCoreCompatDetails.pkgVersion,
107
- dataStoreVersion: maybeDataStoreCompatDetails?.pkgVersion,
108
- runtimeGeneration: runtimeCoreCompatDetails.generation,
109
- dataStoreGeneration: maybeDataStoreCompatDetails?.generation,
110
- minSupportedGeneration: dataStoreSupportRequirementsForRuntime.minSupportedGeneration,
111
- isGenerationCompatible: layerCheckResult.isGenerationCompatible,
112
- unsupportedFeatures: layerCheckResult.unsupportedFeatures,
113
- }),
114
- });
115
- disposeFn();
116
- throw error;
117
- }
85
+ export function validateDatastoreCompatibility(maybeDataStoreCompatDetailsForRuntime, disposeFn, logger) {
86
+ validateLayerCompatibility("runtime", "dataStore", runtimeCompatDetailsForDataStore, dataStoreSupportRequirementsForRuntime, maybeDataStoreCompatDetailsForRuntime, disposeFn, logger);
118
87
  }
119
88
  //# sourceMappingURL=runtimeLayerCompatState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeLayerCompatState.js","sourceRoot":"","sources":["../src/runtimeLayerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,uBAAuB,GAGvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACN,+BAA+B,EAC/B,qBAAqB,GACrB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CA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AE,UAAU;gBAChE,sBAAsB,EAAE,mCAAmC,CAAC,sBAAsB;gBAClF,sBAAsB,EAAE,gBAAgB,CAAC,sBAAsB;gBAC/D,mBAAmB,EAAE,gBAAgB,CAAC,mBAAmB;aACzD,CAAC;SACF,CAAC,CAAC;QACH,SAAS,CAAC,KAAK,CAAC,CAAC;QACjB,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAC7C,2BAA4D,EAC5D,SAAqB;IAErB,MAAM,gBAAgB,GAAG,uBAAuB,CAC/C,sCAAsC,EACtC,2BAA2B,CAC3B,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,0CAA0C,EAAE;YACxE,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC;gBAC5B,cAAc,EAAE,wBAAwB,CAAC,UAAU;gBACnD,gBAAgB,EAAE,2BAA2B,EAAE,UAAU;gBACzD,iBAAiB,EAAE,wBAAwB,CAAC,UAAU;gBACtD,mBAAmB,EAAE,2BAA2B,EAAE,UAAU;gBAC5D,sBAAsB,EAAE,sCAAsC,CAAC,sBAAsB;gBACrF,sBAAsB,EAAE,gBAAgB,CAAC,sBAAsB;gBAC/D,mBAAmB,EAAE,gBAAgB,CAAC,mBAAmB;aACzD,CAAC;SACF,CAAC,CAAC;QACH,SAAS,EAAE,CAAC;QACZ,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tcheckLayerCompatibility,\n\ttype ILayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport {\n\tencodeHandlesInContainerRuntime,\n\tnotifiesReadOnlyState,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The core compatibility details of the Runtime layer that is the same across all layer boundaries.\n * @internal\n */\nexport const runtimeCoreCompatDetails = {\n\t/**\n\t * The package version of the Runtime layer.\n\t */\n\tpkgVersion,\n\t/**\n\t * The current generation of the Runtime layer.\n\t */\n\tgeneration: 1,\n};\n\n/**\n * Runtime's compatibility details that is exposed to the Loader layer.\n * @internal\n */\nexport const runtimeCompatDetailsForLoader: ILayerCompatDetails = {\n\t...runtimeCoreCompatDetails,\n\t/**\n\t * The features supported by the Runtime layer across the Runtime / Loader boundary.\n\t */\n\tsupportedFeatures: new Set<string>(),\n};\n\n/**\n * The requirements that the Loader layer must meet to be compatible with this Runtime.\n * @internal\n */\nexport const loaderSupportRequirementsForRuntime: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that Loader must be at to be compatible with Runtime. Note that 0 is used here so\n\t * that Loader layers before the introduction of the layer compatibility enforcement are compatible.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the Loader must support to be compatible with Runtime.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Runtime's compatibility details that is exposed to the DataStore layer.\n * @internal\n */\nexport const runtimeCompatDetailsForDataStore: ILayerCompatDetails = {\n\t...runtimeCoreCompatDetails,\n\t/**\n\t * The features supported by the Runtime layer across the Runtime / DataStore boundary.\n\t */\n\tsupportedFeatures: new Set<string>([encodeHandlesInContainerRuntime, notifiesReadOnlyState]),\n};\n\n/**\n * The requirements that the DataStore layer must meet to be compatible with this Runtime.\n * @internal\n */\nexport const dataStoreSupportRequirementsForRuntime: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that DataStore must be at to be compatible with Runtime. Note that 0 is used here so\n\t * that DataStore layers before the introduction of the layer compatibility enforcement are compatible.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the DataStore must support to be compatible with Runtime.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Validates that the Loader layer is compatible with this Runtime.\n * @internal\n */\nexport function validateLoaderCompatibility(\n\tmaybeLoaderCompatDetailsForRuntime: ILayerCompatDetails | undefined,\n\tdisposeFn: (error?: ICriticalContainerError) => void,\n): void {\n\tconst layerCheckResult = checkLayerCompatibility(\n\t\tloaderSupportRequirementsForRuntime,\n\t\tmaybeLoaderCompatDetailsForRuntime,\n\t);\n\tif (!layerCheckResult.isCompatible) {\n\t\tconst error = new UsageError(\"Runtime is not compatible with Loader\", {\n\t\t\terrorDetails: JSON.stringify({\n\t\t\t\truntimeVersion: runtimeCoreCompatDetails.pkgVersion,\n\t\t\t\tloaderVersion: maybeLoaderCompatDetailsForRuntime?.pkgVersion,\n\t\t\t\truntimeGeneration: runtimeCoreCompatDetails.generation,\n\t\t\t\tloaderGeneration: maybeLoaderCompatDetailsForRuntime?.generation,\n\t\t\t\tminSupportedGeneration: loaderSupportRequirementsForRuntime.minSupportedGeneration,\n\t\t\t\tisGenerationCompatible: layerCheckResult.isGenerationCompatible,\n\t\t\t\tunsupportedFeatures: layerCheckResult.unsupportedFeatures,\n\t\t\t}),\n\t\t});\n\t\tdisposeFn(error);\n\t\tthrow error;\n\t}\n}\n\n/**\n * Validates that the DataStore layer is compatible with this Runtime.\n * @internal\n */\nexport function validateDatastoreCompatibility(\n\tmaybeDataStoreCompatDetails: ILayerCompatDetails | undefined,\n\tdisposeFn: () => void,\n): void {\n\tconst layerCheckResult = checkLayerCompatibility(\n\t\tdataStoreSupportRequirementsForRuntime,\n\t\tmaybeDataStoreCompatDetails,\n\t);\n\tif (!layerCheckResult.isCompatible) {\n\t\tconst error = new UsageError(\"Runtime is not compatible with DataStore\", {\n\t\t\terrorDetails: JSON.stringify({\n\t\t\t\truntimeVersion: runtimeCoreCompatDetails.pkgVersion,\n\t\t\t\tdataStoreVersion: maybeDataStoreCompatDetails?.pkgVersion,\n\t\t\t\truntimeGeneration: runtimeCoreCompatDetails.generation,\n\t\t\t\tdataStoreGeneration: maybeDataStoreCompatDetails?.generation,\n\t\t\t\tminSupportedGeneration: dataStoreSupportRequirementsForRuntime.minSupportedGeneration,\n\t\t\t\tisGenerationCompatible: layerCheckResult.isGenerationCompatible,\n\t\t\t\tunsupportedFeatures: layerCheckResult.unsupportedFeatures,\n\t\t\t}),\n\t\t});\n\t\tdisposeFn();\n\t\tthrow error;\n\t}\n}\n"]}
1
+ {"version":3,"file":"runtimeLayerCompatState.js","sourceRoot":"","sources":["../src/runtimeLayerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EACN,+BAA+B,EAC/B,qBAAqB,GACrB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,0BAA0B,GAE1B,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACvC;;OAEG;IACH,UAAU;IACV;;OAEG;IACH,UAAU,EAAE,CAAC;CACb,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAwB;IACjE,GAAG,wBAAwB;IAC3B;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,EAAU;CACpC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAoC;IACnF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAwB;IACpE,GAAG,wBAAwB;IAC3B;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,CAAS,CAAC,+BAA+B,EAAE,qBAAqB,CAAC,CAAC;CAC5F,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAoC;IACtF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAC1C,kCAAmE,EACnE,SAAoD,EACpD,MAA2B;IAE3B,0BAA0B,CACzB,SAAS,EACT,QAAQ,EACR,6BAA6B,EAC7B,mCAAmC,EACnC,kCAAkC,EAClC,SAAS,EACT,MAAM,CACN,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAC7C,qCAAsE,EACtE,SAAqB,EACrB,MAA2B;IAE3B,0BAA0B,CACzB,SAAS,EACT,WAAW,EACX,gCAAgC,EAChC,sCAAsC,EACtC,qCAAqC,EACrC,SAAS,EACT,MAAM,CACN,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport {\n\tencodeHandlesInContainerRuntime,\n\tnotifiesReadOnlyState,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tvalidateLayerCompatibility,\n\ttype ITelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The core compatibility details of the Runtime layer that is the same across all layer boundaries.\n * @internal\n */\nexport const runtimeCoreCompatDetails = {\n\t/**\n\t * The package version of the Runtime layer.\n\t */\n\tpkgVersion,\n\t/**\n\t * The current generation of the Runtime layer.\n\t */\n\tgeneration: 1,\n};\n\n/**\n * Runtime's compatibility details that is exposed to the Loader layer.\n * @internal\n */\nexport const runtimeCompatDetailsForLoader: ILayerCompatDetails = {\n\t...runtimeCoreCompatDetails,\n\t/**\n\t * The features supported by the Runtime layer across the Runtime / Loader boundary.\n\t */\n\tsupportedFeatures: new Set<string>(),\n};\n\n/**\n * The requirements that the Loader layer must meet to be compatible with this Runtime.\n * @internal\n */\nexport const loaderSupportRequirementsForRuntime: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that Loader must be at to be compatible with Runtime. Note that 0 is used here so\n\t * that Loader layers before the introduction of the layer compatibility enforcement are compatible.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the Loader must support to be compatible with Runtime.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Runtime's compatibility details that is exposed to the DataStore layer.\n * @internal\n */\nexport const runtimeCompatDetailsForDataStore: ILayerCompatDetails = {\n\t...runtimeCoreCompatDetails,\n\t/**\n\t * The features supported by the Runtime layer across the Runtime / DataStore boundary.\n\t */\n\tsupportedFeatures: new Set<string>([encodeHandlesInContainerRuntime, notifiesReadOnlyState]),\n};\n\n/**\n * The requirements that the DataStore layer must meet to be compatible with this Runtime.\n * @internal\n */\nexport const dataStoreSupportRequirementsForRuntime: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that DataStore must be at to be compatible with Runtime. Note that 0 is used here so\n\t * that DataStore layers before the introduction of the layer compatibility enforcement are compatible.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the DataStore must support to be compatible with Runtime.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Validates that the Loader layer is compatible with this Runtime.\n * @internal\n */\nexport function validateLoaderCompatibility(\n\tmaybeLoaderCompatDetailsForRuntime: ILayerCompatDetails | undefined,\n\tdisposeFn: (error?: ICriticalContainerError) => void,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tvalidateLayerCompatibility(\n\t\t\"runtime\",\n\t\t\"loader\",\n\t\truntimeCompatDetailsForLoader,\n\t\tloaderSupportRequirementsForRuntime,\n\t\tmaybeLoaderCompatDetailsForRuntime,\n\t\tdisposeFn,\n\t\tlogger,\n\t);\n}\n\n/**\n * Validates that the DataStore layer is compatible with this Runtime.\n * @internal\n */\nexport function validateDatastoreCompatibility(\n\tmaybeDataStoreCompatDetailsForRuntime: ILayerCompatDetails | undefined,\n\tdisposeFn: () => void,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tvalidateLayerCompatibility(\n\t\t\"runtime\",\n\t\t\"dataStore\",\n\t\truntimeCompatDetailsForDataStore,\n\t\tdataStoreSupportRequirementsForRuntime,\n\t\tmaybeDataStoreCompatDetailsForRuntime,\n\t\tdisposeFn,\n\t\tlogger,\n\t);\n}\n"]}
@@ -2,7 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { FetchSource, ICreateBlobResponse, IDocumentStorageServicePolicies, ISnapshot, ISnapshotFetchOptions, ISnapshotTree, ISummaryContext, ISummaryHandle, ISummaryTree, IVersion } from "@fluidframework/driver-definitions/internal";
6
5
  import type { IRuntimeStorageService } from "@fluidframework/runtime-definitions/internal";
7
6
  /**
8
7
  * IRuntimeStorageService proxy which intercepts requests if they can be satisfied by the blobs received in the
@@ -12,41 +11,6 @@ export declare class StorageServiceWithAttachBlobs implements IRuntimeStorageSer
12
11
  private readonly internalStorageService;
13
12
  private readonly attachBlobs;
14
13
  constructor(internalStorageService: IRuntimeStorageService, attachBlobs: Map<string, ArrayBufferLike>);
15
- /**
16
- * {@link IRuntimeStorageService.policies}.
17
- * @deprecated This will be removed in a future release. The DataStore layer does not need this.
18
- */
19
- get policies(): IDocumentStorageServicePolicies | undefined;
20
14
  readBlob(id: string): Promise<ArrayBufferLike>;
21
- /**
22
- * {@link IRuntimeStorageService.getSnapshotTree}.
23
- * @deprecated This will be removed in a future release. The DataStore layer does not need this.
24
- */
25
- getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;
26
- /**
27
- * {@link IRuntimeStorageService.getSnapshot}.
28
- * @deprecated This will be removed in a future release. The DataStore layer does not need this.
29
- */
30
- getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
31
- /**
32
- * {@link IRuntimeStorageService.getVersions}.
33
- * @deprecated This will be removed in a future release. The DataStore layer does not need this.
34
- */
35
- getVersions(versionId: string | null, count: number, scenarioName?: string, fetchSource?: FetchSource): Promise<IVersion[]>;
36
- /**
37
- * {@link IRuntimeStorageService.uploadSummaryWithContext}.
38
- * @deprecated This will be removed in a future release. The DataStore layer does not need this.
39
- */
40
- uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
41
- /**
42
- * {@link IRuntimeStorageService.createBlob}.
43
- * @deprecated This will be removed in a future release. The DataStore layer does not need this.
44
- */
45
- createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
46
- /**
47
- * {@link IRuntimeStorageService.downloadSummary}.
48
- * @deprecated This will be removed in a future release. The DataStore layer does not need this.
49
- */
50
- downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
51
15
  }
52
16
  //# sourceMappingURL=storageServiceWithAttachBlobs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"storageServiceWithAttachBlobs.d.ts","sourceRoot":"","sources":["../src/storageServiceWithAttachBlobs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,WAAW,EACX,mBAAmB,EACnB,+BAA+B,EAC/B,SAAS,EACT,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AAG3F;;;GAGG;AACH,qBAAa,6BAA8B,YAAW,sBAAsB;IAE1E,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,WAAW;gBADX,sBAAsB,EAAE,sBAAsB,EAC9C,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC;IAG3D;;;OAGG;IACH,IAAW,QAAQ,IAAI,+BAA+B,GAAG,SAAS,CAEjE;IAEY,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAW3D;;;OAGG;IACU,eAAe,CAC3B,OAAO,CAAC,EAAE,QAAQ,EAClB,YAAY,CAAC,EAAE,MAAM,GAEnB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAIhC;;;OAGG;IACU,WAAW,CAAC,oBAAoB,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC;IAS1F;;;OAGG;IACU,WAAW,CAEvB,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,WAAW,GACvB,OAAO,CAAC,QAAQ,EAAE,CAAC;IAStB;;;OAGG;IACU,wBAAwB,CACpC,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,MAAM,CAAC;IAIlB;;;OAGG;IACU,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI5E;;;OAGG;IACU,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;CAG3E"}
1
+ {"version":3,"file":"storageServiceWithAttachBlobs.d.ts","sourceRoot":"","sources":["../src/storageServiceWithAttachBlobs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AAE3F;;;GAGG;AACH,qBAAa,6BAA8B,YAAW,sBAAsB;IAE1E,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,WAAW;gBADX,sBAAsB,EAAE,sBAAsB,EAC9C,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC;IAG9C,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;CAU3D"}
@@ -2,7 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { UsageError } from "@fluidframework/telemetry-utils/internal";
6
5
  /**
7
6
  * IRuntimeStorageService proxy which intercepts requests if they can be satisfied by the blobs received in the
8
7
  * attach message. We use this to avoid an unnecessary request to the storage service.
@@ -12,13 +11,6 @@ export class StorageServiceWithAttachBlobs {
12
11
  this.internalStorageService = internalStorageService;
13
12
  this.attachBlobs = attachBlobs;
14
13
  }
15
- /**
16
- * {@link IRuntimeStorageService.policies}.
17
- * @deprecated This will be removed in a future release. The DataStore layer does not need this.
18
- */
19
- get policies() {
20
- return this.internalStorageService.policies;
21
- }
22
14
  async readBlob(id) {
23
15
  const blob = this.attachBlobs.get(id);
24
16
  if (blob !== undefined) {
@@ -28,52 +20,5 @@ export class StorageServiceWithAttachBlobs {
28
20
  // IRuntimeStorageService to cache appropriately, no need to double-cache.
29
21
  return this.internalStorageService.readBlob(id);
30
22
  }
31
- /**
32
- * {@link IRuntimeStorageService.getSnapshotTree}.
33
- * @deprecated This will be removed in a future release. The DataStore layer does not need this.
34
- */
35
- async getSnapshotTree(version, scenarioName) {
36
- return this.internalStorageService.getSnapshotTree(version, scenarioName);
37
- }
38
- /**
39
- * {@link IRuntimeStorageService.getSnapshot}.
40
- * @deprecated This will be removed in a future release. The DataStore layer does not need this.
41
- */
42
- async getSnapshot(snapshotFetchOptions) {
43
- if (this.internalStorageService.getSnapshot !== undefined) {
44
- return this.internalStorageService.getSnapshot(snapshotFetchOptions);
45
- }
46
- throw new UsageError("getSnapshot api should exist on internal storage in documentStorageServiceProxy class");
47
- }
48
- /**
49
- * {@link IRuntimeStorageService.getVersions}.
50
- * @deprecated This will be removed in a future release. The DataStore layer does not need this.
51
- */
52
- async getVersions(
53
- // eslint-disable-next-line @rushstack/no-new-null
54
- versionId, count, scenarioName, fetchSource) {
55
- return this.internalStorageService.getVersions(versionId, count, scenarioName, fetchSource);
56
- }
57
- /**
58
- * {@link IRuntimeStorageService.uploadSummaryWithContext}.
59
- * @deprecated This will be removed in a future release. The DataStore layer does not need this.
60
- */
61
- async uploadSummaryWithContext(summary, context) {
62
- return this.internalStorageService.uploadSummaryWithContext(summary, context);
63
- }
64
- /**
65
- * {@link IRuntimeStorageService.createBlob}.
66
- * @deprecated This will be removed in a future release. The DataStore layer does not need this.
67
- */
68
- async createBlob(file) {
69
- return this.internalStorageService.createBlob(file);
70
- }
71
- /**
72
- * {@link IRuntimeStorageService.downloadSummary}.
73
- * @deprecated This will be removed in a future release. The DataStore layer does not need this.
74
- */
75
- async downloadSummary(handle) {
76
- return this.internalStorageService.downloadSummary(handle);
77
- }
78
23
  }
79
24
  //# sourceMappingURL=storageServiceWithAttachBlobs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"storageServiceWithAttachBlobs.js","sourceRoot":"","sources":["../src/storageServiceWithAttachBlobs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE;;;GAGG;AACH,MAAM,OAAO,6BAA6B;IACzC,YACkB,sBAA8C,EAC9C,WAAyC;QADzC,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC9C,gBAAW,GAAX,WAAW,CAA8B;IACxD,CAAC;IAEJ;;;OAGG;IACH,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,EAAU;QAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACtC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC;QACb,CAAC;QAED,8FAA8F;QAC9F,0EAA0E;QAC1E,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe,CAC3B,OAAkB,EAClB,YAAqB;QAGrB,OAAO,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC3E,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,WAAW,CAAC,oBAA4C;QACpE,IAAI,IAAI,CAAC,sBAAsB,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YAC3D,OAAO,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;QACtE,CAAC;QACD,MAAM,IAAI,UAAU,CACnB,uFAAuF,CACvF,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,WAAW;IACvB,kDAAkD;IAClD,SAAwB,EACxB,KAAa,EACb,YAAqB,EACrB,WAAyB;QAEzB,OAAO,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAC7C,SAAS,EACT,KAAK,EACL,YAAY,EACZ,WAAW,CACX,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,wBAAwB,CACpC,OAAqB,EACrB,OAAwB;QAExB,OAAO,IAAI,CAAC,sBAAsB,CAAC,wBAAwB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,UAAU,CAAC,IAAqB;QAC5C,OAAO,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe,CAAC,MAAsB;QAClD,OAAO,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tFetchSource,\n\tICreateBlobResponse,\n\tIDocumentStorageServicePolicies,\n\tISnapshot,\n\tISnapshotFetchOptions,\n\tISnapshotTree,\n\tISummaryContext,\n\tISummaryHandle,\n\tISummaryTree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport type { IRuntimeStorageService } from \"@fluidframework/runtime-definitions/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * IRuntimeStorageService proxy which intercepts requests if they can be satisfied by the blobs received in the\n * attach message. We use this to avoid an unnecessary request to the storage service.\n */\nexport class StorageServiceWithAttachBlobs implements IRuntimeStorageService {\n\tconstructor(\n\t\tprivate readonly internalStorageService: IRuntimeStorageService,\n\t\tprivate readonly attachBlobs: Map<string, ArrayBufferLike>,\n\t) {}\n\n\t/**\n\t * {@link IRuntimeStorageService.policies}.\n\t * @deprecated This will be removed in a future release. The DataStore layer does not need this.\n\t */\n\tpublic get policies(): IDocumentStorageServicePolicies | undefined {\n\t\treturn this.internalStorageService.policies;\n\t}\n\n\tpublic async readBlob(id: string): Promise<ArrayBufferLike> {\n\t\tconst blob = this.attachBlobs.get(id);\n\t\tif (blob !== undefined) {\n\t\t\treturn blob;\n\t\t}\n\n\t\t// Note that it is intentional not to cache the result of this readBlob - we'll trust the real\n\t\t// IRuntimeStorageService to cache appropriately, no need to double-cache.\n\t\treturn this.internalStorageService.readBlob(id);\n\t}\n\n\t/**\n\t * {@link IRuntimeStorageService.getSnapshotTree}.\n\t * @deprecated This will be removed in a future release. The DataStore layer does not need this.\n\t */\n\tpublic async getSnapshotTree(\n\t\tversion?: IVersion,\n\t\tscenarioName?: string,\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t): Promise<ISnapshotTree | null> {\n\t\treturn this.internalStorageService.getSnapshotTree(version, scenarioName);\n\t}\n\n\t/**\n\t * {@link IRuntimeStorageService.getSnapshot}.\n\t * @deprecated This will be removed in a future release. The DataStore layer does not need this.\n\t */\n\tpublic async getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot> {\n\t\tif (this.internalStorageService.getSnapshot !== undefined) {\n\t\t\treturn this.internalStorageService.getSnapshot(snapshotFetchOptions);\n\t\t}\n\t\tthrow new UsageError(\n\t\t\t\"getSnapshot api should exist on internal storage in documentStorageServiceProxy class\",\n\t\t);\n\t}\n\n\t/**\n\t * {@link IRuntimeStorageService.getVersions}.\n\t * @deprecated This will be removed in a future release. The DataStore layer does not need this.\n\t */\n\tpublic async getVersions(\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]> {\n\t\treturn this.internalStorageService.getVersions(\n\t\t\tversionId,\n\t\t\tcount,\n\t\t\tscenarioName,\n\t\t\tfetchSource,\n\t\t);\n\t}\n\n\t/**\n\t * {@link IRuntimeStorageService.uploadSummaryWithContext}.\n\t * @deprecated This will be removed in a future release. The DataStore layer does not need this.\n\t */\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\treturn this.internalStorageService.uploadSummaryWithContext(summary, context);\n\t}\n\n\t/**\n\t * {@link IRuntimeStorageService.createBlob}.\n\t * @deprecated This will be removed in a future release. The DataStore layer does not need this.\n\t */\n\tpublic async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn this.internalStorageService.createBlob(file);\n\t}\n\n\t/**\n\t * {@link IRuntimeStorageService.downloadSummary}.\n\t * @deprecated This will be removed in a future release. The DataStore layer does not need this.\n\t */\n\tpublic async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n\t\treturn this.internalStorageService.downloadSummary(handle);\n\t}\n}\n"]}
1
+ {"version":3,"file":"storageServiceWithAttachBlobs.js","sourceRoot":"","sources":["../src/storageServiceWithAttachBlobs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,MAAM,OAAO,6BAA6B;IACzC,YACkB,sBAA8C,EAC9C,WAAyC;QADzC,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC9C,gBAAW,GAAX,WAAW,CAA8B;IACxD,CAAC;IAEG,KAAK,CAAC,QAAQ,CAAC,EAAU;QAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACtC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC;QACb,CAAC;QAED,8FAA8F;QAC9F,0EAA0E;QAC1E,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IRuntimeStorageService } from \"@fluidframework/runtime-definitions/internal\";\n\n/**\n * IRuntimeStorageService proxy which intercepts requests if they can be satisfied by the blobs received in the\n * attach message. We use this to avoid an unnecessary request to the storage service.\n */\nexport class StorageServiceWithAttachBlobs implements IRuntimeStorageService {\n\tconstructor(\n\t\tprivate readonly internalStorageService: IRuntimeStorageService,\n\t\tprivate readonly attachBlobs: Map<string, ArrayBufferLike>,\n\t) {}\n\n\tpublic async readBlob(id: string): Promise<ArrayBufferLike> {\n\t\tconst blob = this.attachBlobs.get(id);\n\t\tif (blob !== undefined) {\n\t\t\treturn blob;\n\t\t}\n\n\t\t// Note that it is intentional not to cache the result of this readBlob - we'll trust the real\n\t\t// IRuntimeStorageService to cache appropriately, no need to double-cache.\n\t\treturn this.internalStorageService.readBlob(id);\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-runtime",
3
- "version": "2.70.0-361248",
3
+ "version": "2.70.0-361788",
4
4
  "description": "Fluid container runtime",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -119,18 +119,18 @@
119
119
  "temp-directory": "nyc/.nyc_output"
120
120
  },
121
121
  "dependencies": {
122
- "@fluid-internal/client-utils": "2.70.0-361248",
123
- "@fluidframework/container-definitions": "2.70.0-361248",
124
- "@fluidframework/container-runtime-definitions": "2.70.0-361248",
125
- "@fluidframework/core-interfaces": "2.70.0-361248",
126
- "@fluidframework/core-utils": "2.70.0-361248",
127
- "@fluidframework/datastore": "2.70.0-361248",
128
- "@fluidframework/driver-definitions": "2.70.0-361248",
129
- "@fluidframework/driver-utils": "2.70.0-361248",
130
- "@fluidframework/id-compressor": "2.70.0-361248",
131
- "@fluidframework/runtime-definitions": "2.70.0-361248",
132
- "@fluidframework/runtime-utils": "2.70.0-361248",
133
- "@fluidframework/telemetry-utils": "2.70.0-361248",
122
+ "@fluid-internal/client-utils": "2.70.0-361788",
123
+ "@fluidframework/container-definitions": "2.70.0-361788",
124
+ "@fluidframework/container-runtime-definitions": "2.70.0-361788",
125
+ "@fluidframework/core-interfaces": "2.70.0-361788",
126
+ "@fluidframework/core-utils": "2.70.0-361788",
127
+ "@fluidframework/datastore": "2.70.0-361788",
128
+ "@fluidframework/driver-definitions": "2.70.0-361788",
129
+ "@fluidframework/driver-utils": "2.70.0-361788",
130
+ "@fluidframework/id-compressor": "2.70.0-361788",
131
+ "@fluidframework/runtime-definitions": "2.70.0-361788",
132
+ "@fluidframework/runtime-utils": "2.70.0-361788",
133
+ "@fluidframework/telemetry-utils": "2.70.0-361788",
134
134
  "@tylerbu/sorted-btree-es6": "^1.8.0",
135
135
  "double-ended-queue": "^2.1.0-0",
136
136
  "lz4js": "^0.2.0",
@@ -140,16 +140,16 @@
140
140
  "devDependencies": {
141
141
  "@arethetypeswrong/cli": "^0.17.1",
142
142
  "@biomejs/biome": "~1.9.3",
143
- "@fluid-internal/mocha-test-setup": "2.70.0-361248",
144
- "@fluid-private/stochastic-test-utils": "2.70.0-361248",
145
- "@fluid-private/test-pairwise-generator": "2.70.0-361248",
143
+ "@fluid-internal/mocha-test-setup": "2.70.0-361788",
144
+ "@fluid-private/stochastic-test-utils": "2.70.0-361788",
145
+ "@fluid-private/test-pairwise-generator": "2.70.0-361788",
146
146
  "@fluid-tools/benchmark": "^0.51.0",
147
147
  "@fluid-tools/build-cli": "^0.58.3",
148
148
  "@fluidframework/build-common": "^2.0.3",
149
149
  "@fluidframework/build-tools": "^0.58.3",
150
150
  "@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@2.63.0",
151
151
  "@fluidframework/eslint-config-fluid": "^6.1.0",
152
- "@fluidframework/test-runtime-utils": "2.70.0-361248",
152
+ "@fluidframework/test-runtime-utils": "2.70.0-361788",
153
153
  "@microsoft/api-extractor": "7.52.11",
154
154
  "@types/double-ended-queue": "^2.1.0",
155
155
  "@types/lz4js": "^0.2.0",
@@ -169,6 +169,9 @@
169
169
  },
170
170
  "typeValidation": {
171
171
  "broken": {
172
+ "Interface_LoadContainerRuntimeParams": {
173
+ "backCompat": false
174
+ },
172
175
  "TypeAlias_MinimumVersionForCollab": {
173
176
  "backCompat": false,
174
177
  "forwardCompat": false
@@ -924,7 +924,6 @@ export class BlobManager {
924
924
  public readonly sharePendingBlobs = async (): Promise<void> => {
925
925
  const localIdsToUpload = [...this.pendingOnlyLocalIds];
926
926
  this.pendingOnlyLocalIds.clear();
927
- // TODO: Determine if Promise.all is ergonomic at the callsite. Would Promise.allSettled be better?
928
927
  await Promise.all<void>(
929
928
  localIdsToUpload.map(async (localId) => this.uploadAndAttach(localId)),
930
929
  );