@fluidframework/container-loader 2.53.1 → 2.61.0-355054
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.cjs +1 -2
- package/CHANGELOG.md +4 -0
- package/api-report/{container-loader.legacy.alpha.api.md → container-loader.legacy.beta.api.md} +24 -24
- package/dist/attachment.d.ts +3 -3
- package/dist/attachment.d.ts.map +1 -1
- package/dist/attachment.js.map +1 -1
- package/dist/audience.d.ts +3 -3
- package/dist/audience.d.ts.map +1 -1
- package/dist/audience.js.map +1 -1
- package/dist/catchUpMonitor.d.ts +2 -2
- package/dist/catchUpMonitor.d.ts.map +1 -1
- package/dist/catchUpMonitor.js.map +1 -1
- package/dist/connectionManager.d.ts +7 -7
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js.map +1 -1
- package/dist/connectionStateHandler.d.ts +7 -7
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts +7 -8
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +1 -2
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts +7 -7
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +5 -5
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/contracts.d.ts +5 -5
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/createAndLoadContainerUtils.d.ts +12 -19
- package/dist/createAndLoadContainerUtils.d.ts.map +1 -1
- package/dist/createAndLoadContainerUtils.js +3 -6
- package/dist/createAndLoadContainerUtils.js.map +1 -1
- package/dist/debugLogger.d.ts +2 -2
- package/dist/debugLogger.d.ts.map +1 -1
- package/dist/debugLogger.js.map +1 -1
- package/dist/deltaManager.d.ts +8 -8
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js.map +1 -1
- package/dist/deltaQueue.d.ts +1 -1
- package/dist/deltaQueue.d.ts.map +1 -1
- package/dist/deltaQueue.js.map +1 -1
- package/dist/disposal.d.ts +1 -1
- package/dist/disposal.d.ts.map +1 -1
- package/dist/disposal.js.map +1 -1
- package/dist/error.d.ts +2 -2
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +4 -2
- package/dist/loadPaused.d.ts +2 -2
- package/dist/loadPaused.d.ts.map +1 -1
- package/dist/loadPaused.js.map +1 -1
- package/dist/loader.d.ts +11 -16
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +1 -2
- package/dist/loader.js.map +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts +3 -3
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.js +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
- package/dist/noopHeuristic.d.ts +2 -2
- package/dist/noopHeuristic.d.ts.map +1 -1
- package/dist/noopHeuristic.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/protocol/index.d.ts +2 -2
- package/dist/protocol/index.d.ts.map +1 -1
- package/dist/protocol/index.js.map +1 -1
- package/dist/protocol/protocol.d.ts +5 -7
- package/dist/protocol/protocol.d.ts.map +1 -1
- package/dist/protocol/protocol.js.map +1 -1
- package/dist/protocol/quorum.d.ts +5 -8
- package/dist/protocol/quorum.d.ts.map +1 -1
- package/dist/protocol/quorum.js.map +1 -1
- package/dist/protocol.d.ts +5 -7
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/dist/protocolTreeDocumentStorageService.d.ts +3 -3
- package/dist/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/dist/protocolTreeDocumentStorageService.js.map +1 -1
- package/dist/public.d.ts +2 -1
- package/dist/quorum.d.ts +2 -2
- package/dist/quorum.d.ts.map +1 -1
- package/dist/quorum.js.map +1 -1
- package/dist/retriableDocumentStorageService.d.ts +4 -4
- package/dist/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/retriableDocumentStorageService.js.map +1 -1
- package/dist/serializedStateManager.d.ts +4 -4
- package/dist/serializedStateManager.d.ts.map +1 -1
- package/dist/serializedStateManager.js.map +1 -1
- package/dist/utils.d.ts +6 -9
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -2
- package/dist/utils.js.map +1 -1
- package/internal.d.ts +1 -1
- package/legacy.d.ts +1 -1
- package/lib/attachment.d.ts +3 -3
- package/lib/attachment.d.ts.map +1 -1
- package/lib/attachment.js.map +1 -1
- package/lib/audience.d.ts +3 -3
- package/lib/audience.d.ts.map +1 -1
- package/lib/audience.js.map +1 -1
- package/lib/catchUpMonitor.d.ts +2 -2
- package/lib/catchUpMonitor.d.ts.map +1 -1
- package/lib/catchUpMonitor.js.map +1 -1
- package/lib/connectionManager.d.ts +7 -7
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js.map +1 -1
- package/lib/connectionStateHandler.d.ts +7 -7
- package/lib/connectionStateHandler.d.ts.map +1 -1
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts +7 -8
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +1 -2
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts +7 -7
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +5 -5
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/contracts.d.ts +5 -5
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contracts.js.map +1 -1
- package/lib/createAndLoadContainerUtils.d.ts +12 -19
- package/lib/createAndLoadContainerUtils.d.ts.map +1 -1
- package/lib/createAndLoadContainerUtils.js +3 -6
- package/lib/createAndLoadContainerUtils.js.map +1 -1
- package/lib/debugLogger.d.ts +2 -2
- package/lib/debugLogger.d.ts.map +1 -1
- package/lib/debugLogger.js.map +1 -1
- package/lib/deltaManager.d.ts +8 -8
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js.map +1 -1
- package/lib/deltaQueue.d.ts +1 -1
- package/lib/deltaQueue.d.ts.map +1 -1
- package/lib/deltaQueue.js.map +1 -1
- package/lib/disposal.d.ts +1 -1
- package/lib/disposal.d.ts.map +1 -1
- package/lib/disposal.js.map +1 -1
- package/lib/error.d.ts +2 -2
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/index.d.ts +6 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +4 -2
- package/lib/loadPaused.d.ts +2 -2
- package/lib/loadPaused.d.ts.map +1 -1
- package/lib/loadPaused.js.map +1 -1
- package/lib/loader.d.ts +11 -16
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js +1 -2
- package/lib/loader.js.map +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts +3 -3
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.js +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
- package/lib/noopHeuristic.d.ts +2 -2
- package/lib/noopHeuristic.d.ts.map +1 -1
- package/lib/noopHeuristic.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/protocol/index.d.ts +2 -2
- package/lib/protocol/index.d.ts.map +1 -1
- package/lib/protocol/index.js.map +1 -1
- package/lib/protocol/protocol.d.ts +5 -7
- package/lib/protocol/protocol.d.ts.map +1 -1
- package/lib/protocol/protocol.js.map +1 -1
- package/lib/protocol/quorum.d.ts +5 -8
- package/lib/protocol/quorum.d.ts.map +1 -1
- package/lib/protocol/quorum.js.map +1 -1
- package/lib/protocol.d.ts +5 -7
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +1 -1
- package/lib/protocol.js.map +1 -1
- package/lib/protocolTreeDocumentStorageService.d.ts +3 -3
- package/lib/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/lib/protocolTreeDocumentStorageService.js.map +1 -1
- package/lib/public.d.ts +2 -1
- package/lib/quorum.d.ts +2 -2
- package/lib/quorum.d.ts.map +1 -1
- package/lib/quorum.js.map +1 -1
- package/lib/retriableDocumentStorageService.d.ts +4 -4
- package/lib/retriableDocumentStorageService.d.ts.map +1 -1
- package/lib/retriableDocumentStorageService.js.map +1 -1
- package/lib/serializedStateManager.d.ts +4 -4
- package/lib/serializedStateManager.d.ts.map +1 -1
- package/lib/serializedStateManager.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/utils.d.ts +6 -9
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +1 -2
- package/lib/utils.js.map +1 -1
- package/package.json +21 -21
- package/src/attachment.ts +3 -3
- package/src/audience.ts +3 -3
- package/src/catchUpMonitor.ts +3 -3
- package/src/connectionManager.ts +30 -23
- package/src/connectionStateHandler.ts +9 -9
- package/src/container.ts +44 -45
- package/src/containerContext.ts +8 -8
- package/src/containerStorageAdapter.ts +6 -6
- package/src/contracts.ts +8 -8
- package/src/createAndLoadContainerUtils.ts +13 -20
- package/src/debugLogger.ts +3 -3
- package/src/deltaManager.ts +15 -15
- package/src/deltaQueue.ts +1 -1
- package/src/disposal.ts +1 -1
- package/src/error.ts +4 -4
- package/src/index.ts +12 -12
- package/src/loadPaused.ts +2 -3
- package/src/loader.ts +18 -23
- package/src/location-redirection-utilities/resolveWithLocationRedirection.ts +4 -4
- package/src/noopHeuristic.ts +2 -2
- package/src/packageVersion.ts +1 -1
- package/src/protocol/index.ts +5 -5
- package/src/protocol/protocol.ts +13 -15
- package/src/protocol/quorum.ts +5 -8
- package/src/protocol.ts +13 -11
- package/src/protocolTreeDocumentStorageService.ts +4 -4
- package/src/quorum.ts +2 -2
- package/src/retriableDocumentStorageService.ts +4 -4
- package/src/serializedStateManager.ts +9 -9
- package/src/utils.ts +9 -13
package/dist/loadPaused.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadPaused.d.ts","sourceRoot":"","sources":["../src/loadPaused.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGN,KAAK,UAAU,EACf,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"loadPaused.d.ts","sourceRoot":"","sources":["../src/loadPaused.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGN,KAAK,UAAU,EACf,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,iCAAiC,CAAC;AAK5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIhD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,mBAAmB,CACxC,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,QAAQ,EACjB,oBAAoB,CAAC,EAAE,MAAM,EAC7B,MAAM,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,UAAU,CAAC,CAwGrB"}
|
package/dist/loadPaused.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadPaused.js","sourceRoot":"","sources":["../src/loadPaused.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6EAIwD;AAGxD,kEAA6D;AAC7D,uEAAwE;AAExE,qFAAyE;AAGzE,4CAA4C;AA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AAS,CAAC,UAAU,EAAE,CAAC;QAEvB,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC/B,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACjC,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEJ,OAAO,SAAS,CAAC;AAClB,CAAC;AA7GD,kDA6GC;AAED,2CAA2C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tisIDeltaManagerFull,\n\tLoaderHeader,\n\ttype IContainer,\n} from \"@fluidframework/container-definitions/internal\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport type { IErrorBase } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { GenericError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { loadExistingContainer } from \"./createAndLoadContainerUtils.js\";\nimport { type ILoaderProps } from \"./loader.js\";\n\n/* eslint-disable jsdoc/check-indentation */\n\n/**\n * Loads container and leaves it in a state where it does not process any ops.\n * Container instance returned by this function is in special mode where some functionality that is available in normal use will not work correctly\n * with instance of container returned by this function. Some examples:\n * 1. calling IContainer.connect() will have very little impact on this container as it will not process ops.\n * 2. functionality like waitContainerToCatchUp() or waiting for ops in any other way would hand infinitely, as this container is not processing ops\n * 3. No changes can be made to this container - they will be lost.\n *\n * If sequence number is provided, loads up to this sequence number and stops there, otherwise stops immediately after loading snapshot.\n * In all cases, container is returned disconnected & paused, or an exception is thrown\n * Notes:\n * 1. Ignores LoaderHeader.loadMode headers. Container is always returned with ops applied upt to provided sequence number,\n * or no ops applied at all (if sequence number is not provided)\n * 2. This call can hang infinitately if disconnected from internet (or hit some other conditions, like 429 storm).\n * Compare to Container.load() experience (with default settings) - it either returns failure right away, or succeeds, with\n * ops fetching / delta connection happening in parallel / after container load flow, and thus providing an object (Container instance) to observe\n * network connectivity issues / ability to cancel (IContainer.disconnect) or close container (IContainer.close)\n * This flow needs to fetch ops (potentially connecting to delta connection), and any retriable errors on this path result in infinite retry.\n * If you need to cancel that process, consider supplying AbortSignal parameter.\n * @param loaderProps - The loader props to use to load the container.\n * @param request - request identifying container instance / load parameters. LoaderHeader.loadMode headers are ignored (see above)\n * @param loadToSequenceNumber - optional sequence number. If provided, ops are processed up to this sequence number.\n * @param signal - optional abort signal that can be used to cancel waiting for the ops.\n * @returns IContainer instance\n *\n * @internal\n */\nexport async function loadContainerPaused(\n\tloaderProps: ILoaderProps,\n\trequest: IRequest,\n\tloadToSequenceNumber?: number,\n\tsignal?: AbortSignal,\n): Promise<IContainer> {\n\tconst container = await loadExistingContainer({\n\t\t...loaderProps,\n\t\trequest: {\n\t\t\turl: request.url,\n\t\t\theaders: {\n\t\t\t\t...request.headers,\n\t\t\t\t// ensure we do not process any ops, such that we can examine container before ops starts to flow.\n\t\t\t\t[LoaderHeader.loadMode]: { opsBeforeReturn: undefined, deltaConnection: \"none\" },\n\t\t\t},\n\t\t},\n\t});\n\n\t// Force readonly mode - this will ensure we don't receive an error for the lack of join op\n\tcontainer.forceReadonly?.(true);\n\n\tconst dm = container.deltaManager;\n\tconst lastProcessedSequenceNumber = dm.initialSequenceNumber;\n\n\tconst pauseContainer = (): void => {\n\t\tassert(\n\t\t\tisIDeltaManagerFull(dm),\n\t\t\t0xa7f /* Delta manager does not have inbound/outbound queues. */,\n\t\t);\n\t\t// eslint-disable-next-line no-void\n\t\tvoid dm.inbound.pause();\n\t\t// eslint-disable-next-line no-void\n\t\tvoid dm.outbound.pause();\n\t};\n\n\t// Happy path - we are already there.\n\tif (\n\t\tloadToSequenceNumber === undefined ||\n\t\tlastProcessedSequenceNumber === loadToSequenceNumber\n\t) {\n\t\t// If we have already reached the desired sequence number, call pauseContainer() to pause immediately.\n\t\tpauseContainer();\n\t\treturn container;\n\t}\n\n\t// If we are trying to pause at a specific sequence number, ensure the latest snapshot is not newer than the desired sequence number.\n\tif (lastProcessedSequenceNumber > loadToSequenceNumber) {\n\t\tconst error = new GenericError(\n\t\t\t\"Cannot satisfy request to pause the container at the specified sequence number. Most recent snapshot is newer than the specified sequence number.\",\n\t\t);\n\t\tcontainer.close(error);\n\t\tthrow error;\n\t}\n\n\tlet opHandler: () => void;\n\tlet onAbort: () => void;\n\tlet onClose: (error?: IErrorBase) => void;\n\n\tconst promise = new Promise<void>((resolve, reject) => {\n\t\tonAbort = (): void => reject(new GenericError(\"Canceled due to cancellation request.\"));\n\t\tonClose = (error?: IErrorBase): void => reject(error);\n\n\t\t// We need to setup a listener to stop op processing once we reach the desired sequence number (if specified).\n\t\topHandler = (): void => {\n\t\t\t// If there is a specified sequence number, keep processing until we reach it.\n\t\t\tif (\n\t\t\t\tloadToSequenceNumber !== undefined &&\n\t\t\t\tdm.lastSequenceNumber >= loadToSequenceNumber\n\t\t\t) {\n\t\t\t\t// Pause op processing once we have processed the desired number of ops.\n\t\t\t\tpauseContainer();\n\t\t\t\tresolve();\n\t\t\t}\n\t\t};\n\n\t\t// If we have not yet reached the desired sequence number, setup a listener to pause once we reach it.\n\t\tsignal?.addEventListener(\"abort\", onAbort);\n\t\tcontainer.on(\"op\", opHandler);\n\t\tcontainer.on(\"closed\", onClose);\n\t});\n\n\t// There are no guarantees on when ops will land in storage.\n\t// No guarantees that driver implements ops caching (i.e. ops observed in previous session can be served from cache)\n\t// or that browser will provide caching capabilities / keep the data (localStorage).\n\t// Thus, we have to ensure we connect to delta storage in order to make forward progress with ops.\n\t// We also instructed not to fetch / apply any ops from storage above (to be able to install callback above before ops are processed),\n\t// connect() call will fetch ops as needed.\n\tcontainer.connect();\n\n\t// Wait for the ops to be processed.\n\tawait promise\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t.catch((error: any) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\t\t\tcontainer.close(error);\n\t\t\tthrow error;\n\t\t})\n\t\t.finally(() => {\n\t\t\t// There is not much value in leaving delta connection on. We are not processing ops, we also can't advance to \"connected\" state because of it.\n\t\t\t// We are not sending ops (due to forceReadonly() call above). We are holding collab window and any consensus-based processes.\n\t\t\t// It's better not to have connection in such case, as there are only nagatives, and no positives.\n\t\t\tcontainer.disconnect();\n\n\t\t\tcontainer.off(\"op\", opHandler);\n\t\t\tcontainer.off(\"closed\", onClose);\n\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t});\n\n\treturn container;\n}\n\n/* eslint-enable jsdoc/check-indentation */\n"]}
|
|
1
|
+
{"version":3,"file":"loadPaused.js","sourceRoot":"","sources":["../src/loadPaused.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6EAIwD;AAExD,kEAA6D;AAC7D,uEAAwE;AAExE,qFAAyE;AAGzE,4CAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,KAAK,UAAU,mBAAmB,CACxC,WAAyB,EACzB,OAAiB,EACjB,oBAA6B,EAC7B,MAAoB;IAEpB,MAAM,SAAS,GAAG,MAAM,IAAA,sDAAqB,EAAC;QAC7C,GAAG,WAAW;QACd,OAAO,EAAE;YACR,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,OAAO,EAAE;gBACR,GAAG,OAAO,CAAC,OAAO;gBAClB,kGAAkG;gBAClG,CAAC,uBAAY,CAAC,QAAQ,CAAC,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE;aAChF;SACD;KACD,CAAC,CAAC;IAEH,2FAA2F;IAC3F,SAAS,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC;IAEhC,MAAM,EAAE,GAAG,SAAS,CAAC,YAAY,CAAC;IAClC,MAAM,2BAA2B,GAAG,EAAE,CAAC,qBAAqB,CAAC;IAE7D,MAAM,cAAc,GAAG,GAAS,EAAE;QACjC,IAAA,iBAAM,EACL,IAAA,8BAAmB,EAAC,EAAE,CA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AC,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC9B,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,4DAA4D;IAC5D,oHAAoH;IACpH,oFAAoF;IACpF,kGAAkG;IAClG,sIAAsI;IACtI,2CAA2C;IAC3C,SAAS,CAAC,OAAO,EAAE,CAAC;IAEpB,oCAAoC;IACpC,MAAM,OAAO;QACZ,8DAA8D;SAC7D,KAAK,CAAC,CAAC,KAAU,EAAE,EAAE;QACrB,iEAAiE;QACjE,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvB,MAAM,KAAK,CAAC;IACb,CAAC,CAAC;SACD,OAAO,CAAC,GAAG,EAAE;QACb,+IAA+I;QAC/I,8HAA8H;QAC9H,kGAAkG;QAClG,SAAS,CAAC,UAAU,EAAE,CAAC;QAEvB,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC/B,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACjC,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEJ,OAAO,SAAS,CAAC;AAClB,CAAC;AA7GD,kDA6GC;AAED,2CAA2C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tisIDeltaManagerFull,\n\tLoaderHeader,\n\ttype IContainer,\n} from \"@fluidframework/container-definitions/internal\";\nimport type { IRequest, IErrorBase } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { GenericError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { loadExistingContainer } from \"./createAndLoadContainerUtils.js\";\nimport type { ILoaderProps } from \"./loader.js\";\n\n/* eslint-disable jsdoc/check-indentation */\n\n/**\n * Loads container and leaves it in a state where it does not process any ops.\n * Container instance returned by this function is in special mode where some functionality that is available in normal use will not work correctly\n * with instance of container returned by this function. Some examples:\n * 1. calling IContainer.connect() will have very little impact on this container as it will not process ops.\n * 2. functionality like waitContainerToCatchUp() or waiting for ops in any other way would hand infinitely, as this container is not processing ops\n * 3. No changes can be made to this container - they will be lost.\n *\n * If sequence number is provided, loads up to this sequence number and stops there, otherwise stops immediately after loading snapshot.\n * In all cases, container is returned disconnected & paused, or an exception is thrown\n * Notes:\n * 1. Ignores LoaderHeader.loadMode headers. Container is always returned with ops applied upt to provided sequence number,\n * or no ops applied at all (if sequence number is not provided)\n * 2. This call can hang infinitately if disconnected from internet (or hit some other conditions, like 429 storm).\n * Compare to Container.load() experience (with default settings) - it either returns failure right away, or succeeds, with\n * ops fetching / delta connection happening in parallel / after container load flow, and thus providing an object (Container instance) to observe\n * network connectivity issues / ability to cancel (IContainer.disconnect) or close container (IContainer.close)\n * This flow needs to fetch ops (potentially connecting to delta connection), and any retriable errors on this path result in infinite retry.\n * If you need to cancel that process, consider supplying AbortSignal parameter.\n * @param loaderProps - The loader props to use to load the container.\n * @param request - request identifying container instance / load parameters. LoaderHeader.loadMode headers are ignored (see above)\n * @param loadToSequenceNumber - optional sequence number. If provided, ops are processed up to this sequence number.\n * @param signal - optional abort signal that can be used to cancel waiting for the ops.\n * @returns IContainer instance\n *\n * @internal\n */\nexport async function loadContainerPaused(\n\tloaderProps: ILoaderProps,\n\trequest: IRequest,\n\tloadToSequenceNumber?: number,\n\tsignal?: AbortSignal,\n): Promise<IContainer> {\n\tconst container = await loadExistingContainer({\n\t\t...loaderProps,\n\t\trequest: {\n\t\t\turl: request.url,\n\t\t\theaders: {\n\t\t\t\t...request.headers,\n\t\t\t\t// ensure we do not process any ops, such that we can examine container before ops starts to flow.\n\t\t\t\t[LoaderHeader.loadMode]: { opsBeforeReturn: undefined, deltaConnection: \"none\" },\n\t\t\t},\n\t\t},\n\t});\n\n\t// Force readonly mode - this will ensure we don't receive an error for the lack of join op\n\tcontainer.forceReadonly?.(true);\n\n\tconst dm = container.deltaManager;\n\tconst lastProcessedSequenceNumber = dm.initialSequenceNumber;\n\n\tconst pauseContainer = (): void => {\n\t\tassert(\n\t\t\tisIDeltaManagerFull(dm),\n\t\t\t0xa7f /* Delta manager does not have inbound/outbound queues. */,\n\t\t);\n\t\t// eslint-disable-next-line no-void\n\t\tvoid dm.inbound.pause();\n\t\t// eslint-disable-next-line no-void\n\t\tvoid dm.outbound.pause();\n\t};\n\n\t// Happy path - we are already there.\n\tif (\n\t\tloadToSequenceNumber === undefined ||\n\t\tlastProcessedSequenceNumber === loadToSequenceNumber\n\t) {\n\t\t// If we have already reached the desired sequence number, call pauseContainer() to pause immediately.\n\t\tpauseContainer();\n\t\treturn container;\n\t}\n\n\t// If we are trying to pause at a specific sequence number, ensure the latest snapshot is not newer than the desired sequence number.\n\tif (lastProcessedSequenceNumber > loadToSequenceNumber) {\n\t\tconst error = new GenericError(\n\t\t\t\"Cannot satisfy request to pause the container at the specified sequence number. Most recent snapshot is newer than the specified sequence number.\",\n\t\t);\n\t\tcontainer.close(error);\n\t\tthrow error;\n\t}\n\n\tlet opHandler: () => void;\n\tlet onAbort: () => void;\n\tlet onClose: (error?: IErrorBase) => void;\n\n\tconst promise = new Promise<void>((resolve, reject) => {\n\t\tonAbort = (): void => reject(new GenericError(\"Canceled due to cancellation request.\"));\n\t\tonClose = (error?: IErrorBase): void => reject(error);\n\n\t\t// We need to setup a listener to stop op processing once we reach the desired sequence number (if specified).\n\t\topHandler = (): void => {\n\t\t\t// If there is a specified sequence number, keep processing until we reach it.\n\t\t\tif (\n\t\t\t\tloadToSequenceNumber !== undefined &&\n\t\t\t\tdm.lastSequenceNumber >= loadToSequenceNumber\n\t\t\t) {\n\t\t\t\t// Pause op processing once we have processed the desired number of ops.\n\t\t\t\tpauseContainer();\n\t\t\t\tresolve();\n\t\t\t}\n\t\t};\n\n\t\t// If we have not yet reached the desired sequence number, setup a listener to pause once we reach it.\n\t\tsignal?.addEventListener(\"abort\", onAbort);\n\t\tcontainer.on(\"op\", opHandler);\n\t\tcontainer.on(\"closed\", onClose);\n\t});\n\n\t// There are no guarantees on when ops will land in storage.\n\t// No guarantees that driver implements ops caching (i.e. ops observed in previous session can be served from cache)\n\t// or that browser will provide caching capabilities / keep the data (localStorage).\n\t// Thus, we have to ensure we connect to delta storage in order to make forward progress with ops.\n\t// We also instructed not to fetch / apply any ops from storage above (to be able to install callback above before ops are processed),\n\t// connect() call will fetch ops as needed.\n\tcontainer.connect();\n\n\t// Wait for the ops to be processed.\n\tawait promise\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t.catch((error: any) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\t\t\tcontainer.close(error);\n\t\t\tthrow error;\n\t\t})\n\t\t.finally(() => {\n\t\t\t// There is not much value in leaving delta connection on. We are not processing ops, we also can't advance to \"connected\" state because of it.\n\t\t\t// We are not sending ops (due to forceReadonly() call above). We are holding collab window and any consensus-based processes.\n\t\t\t// It's better not to have connection in such case, as there are only nagatives, and no positives.\n\t\t\tcontainer.disconnect();\n\n\t\t\tcontainer.off(\"op\", opHandler);\n\t\t\tcontainer.off(\"closed\", onClose);\n\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t});\n\n\treturn container;\n}\n\n/* eslint-enable jsdoc/check-indentation */\n"]}
|
package/dist/loader.d.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { IContainer, IFluidCodeDetails, IFluidModule, IHostLoader, ILoader, ILoaderOptions, IProvideFluidCodeDetailsComparer } from "@fluidframework/container-definitions/internal";
|
|
6
|
-
import { FluidObject, IConfigProviderBase, IRequest, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
-
import { IClientDetails } from "@fluidframework/driver-definitions";
|
|
8
|
-
import { IDocumentServiceFactory, IUrlResolver } from "@fluidframework/driver-definitions/internal";
|
|
9
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
5
|
+
import { type IContainer, type IFluidCodeDetails, type IFluidModule, type IHostLoader, type ILoader, type ILoaderOptions, type IProvideFluidCodeDetailsComparer } from "@fluidframework/container-definitions/internal";
|
|
6
|
+
import type { FluidObject, IConfigProviderBase, IRequest, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
+
import type { IClientDetails } from "@fluidframework/driver-definitions";
|
|
8
|
+
import type { IDocumentServiceFactory, IUrlResolver } from "@fluidframework/driver-definitions/internal";
|
|
9
|
+
import { type ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
10
10
|
import { Container } from "./container.js";
|
|
11
|
-
import { ProtocolHandlerBuilder } from "./protocol.js";
|
|
11
|
+
import type { ProtocolHandlerBuilder } from "./protocol.js";
|
|
12
12
|
/**
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
@@ -23,8 +23,7 @@ export declare class RelativeLoader implements ILoader {
|
|
|
23
23
|
* {@link @fluidframework/container-definitions#IFluidModuleWithDetails}
|
|
24
24
|
* to have all the code loading modules in one package. #8193
|
|
25
25
|
* Encapsulates a module entry point with corresponding code details.
|
|
26
|
-
* @legacy
|
|
27
|
-
* @alpha
|
|
26
|
+
* @legacy @beta
|
|
28
27
|
*/
|
|
29
28
|
export interface IFluidModuleWithDetails {
|
|
30
29
|
/**
|
|
@@ -43,8 +42,7 @@ export interface IFluidModuleWithDetails {
|
|
|
43
42
|
* to have code loading modules in one package. #8193
|
|
44
43
|
* Fluid code loader resolves a code module matching the document schema, i.e. code details, such as
|
|
45
44
|
* a package name and package version range.
|
|
46
|
-
* @legacy
|
|
47
|
-
* @alpha
|
|
45
|
+
* @legacy @beta
|
|
48
46
|
*/
|
|
49
47
|
export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {
|
|
50
48
|
/**
|
|
@@ -57,8 +55,7 @@ export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComp
|
|
|
57
55
|
}
|
|
58
56
|
/**
|
|
59
57
|
* Services and properties necessary for creating a loader
|
|
60
|
-
* @legacy
|
|
61
|
-
* @alpha
|
|
58
|
+
* @legacy @beta
|
|
62
59
|
*/
|
|
63
60
|
export interface ILoaderProps {
|
|
64
61
|
/**
|
|
@@ -104,8 +101,7 @@ export interface ILoaderProps {
|
|
|
104
101
|
}
|
|
105
102
|
/**
|
|
106
103
|
* Services and properties used by and exposed by the loader
|
|
107
|
-
* @legacy
|
|
108
|
-
* @alpha
|
|
104
|
+
* @legacy @beta
|
|
109
105
|
*/
|
|
110
106
|
export interface ILoaderServices {
|
|
111
107
|
/**
|
|
@@ -147,8 +143,7 @@ export interface ILoaderServices {
|
|
|
147
143
|
}
|
|
148
144
|
/**
|
|
149
145
|
* Manages Fluid resource loading
|
|
150
|
-
* @legacy
|
|
151
|
-
* @alpha
|
|
146
|
+
* @legacy @beta
|
|
152
147
|
*
|
|
153
148
|
* @remarks The Loader class is deprecated and will be removed in a future release. Use the free-form functions instead (See issue #24450 for more details).
|
|
154
149
|
*/
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,gCAAgC,EAErC,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACX,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,oBA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iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;YAU1E,WAAW;YAiCX,aAAa;CAuB3B"}
|
package/dist/loader.js
CHANGED
|
@@ -51,8 +51,7 @@ class RelativeLoader {
|
|
|
51
51
|
exports.RelativeLoader = RelativeLoader;
|
|
52
52
|
/**
|
|
53
53
|
* Manages Fluid resource loading
|
|
54
|
-
* @legacy
|
|
55
|
-
* @alpha
|
|
54
|
+
* @legacy @beta
|
|
56
55
|
*
|
|
57
56
|
* @remarks The Loader class is deprecated and will be removed in a future release. Use the free-form functions instead (See issue #24450 for more details).
|
|
58
57
|
*/
|
package/dist/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6EASwD;AAaxD,uEAOkD;AAClD,+BAAkC;AAElC,iDAA2C;AAC3C,qDAA+C;AAC/C,2DAAiD;AAGjD,yCAGoB;AAEpB,SAAS,wBAAwB,CAChC,QAAkC;IAElC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACjD,CAAC;AACF,CAAC;AACD;;GAEG;AACH,MAAa,cAAc;IAC1B,YACkB,SAAoB,EACpB,MAA2B;QAD3B,cAAS,GAAT,SAAS,CAAW;QACpB,WAAM,GAAN,MAAM,CAAqB;IAC1C,CAAC;IAEG,KAAK,CAAC,OAAO,CAAC,OAAiB;QACrC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACjC,wBAAwB,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YACrD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAC3C;gBACC,WAAW,EAAE,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;gBAC9C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OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,uBAAY,CAAC,OAAO,CAAC,IAAI,SAAS;YAC7D,mEAAmE;YACnE,QAAQ,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,uBAAY,CAAC,QAAQ,CAAC;YAClD,iBAAiB;SACjB,EACD;YACC,mEAAmE;YACnE,YAAY,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,uBAAY,CAAC,SAAS,CAAC;YACvD,mEAAmE;YACnE,qBAAqB,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,uBAAY,CAAC,aAAa,CAAC;YACpE,GAAG,IAAI,CAAC,QAAQ;SAChB,CACD,CAAC;IACH,CAAC;CACD;AA/ID,wBA+IC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIContainer,\n\tIFluidCodeDetails,\n\tIFluidModule,\n\tIHostLoader,\n\tILoader,\n\tILoaderOptions,\n\tIProvideFluidCodeDetailsComparer,\n\tLoaderHeader,\n} from \"@fluidframework/container-definitions/internal\";\nimport {\n\tFluidObject,\n\tIConfigProviderBase,\n\tIRequest,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport { IClientDetails } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tITelemetryLoggerExt,\n\tMonitoringContext,\n\tPerformanceEvent,\n\tcreateChildMonitoringContext,\n\tmixinMonitoringContext,\n\tsessionStorageConfigProvider,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport { Container } from \"./container.js\";\nimport { DebugLogger } from \"./debugLogger.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\nimport { ProtocolHandlerBuilder } from \"./protocol.js\";\nimport type { IPendingContainerState } from \"./serializedStateManager.js\";\nimport {\n\tgetAttachedContainerStateFromSerializedContainer,\n\ttryParseCompatibleResolvedUrl,\n} from \"./utils.js\";\n\nfunction ensureResolvedUrlDefined(\n\tresolved: IResolvedUrl | undefined,\n): asserts resolved is IResolvedUrl {\n\tif (resolved === undefined) {\n\t\tthrow new Error(`Object is not a IResolveUrl.`);\n\t}\n}\n/**\n * @internal\n */\nexport class RelativeLoader implements ILoader {\n\tconstructor(\n\t\tprivate readonly container: Container,\n\t\tprivate readonly loader: ILoader | undefined,\n\t) {}\n\n\tpublic async resolve(request: IRequest): Promise<IContainer> {\n\t\tif (request.url.startsWith(\"/\")) {\n\t\t\tensureResolvedUrlDefined(this.container.resolvedUrl);\n\t\t\tconst container = await this.container.clone(\n\t\t\t\t{\n\t\t\t\t\tresolvedUrl: { ...this.container.resolvedUrl },\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\tversion: request.headers?.[LoaderHeader.version] ?? undefined,\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\tloadMode: request.headers?.[LoaderHeader.loadMode],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\tcanReconnect: request.headers?.[LoaderHeader.reconnect],\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\tclientDetailsOverride: request.headers?.[LoaderHeader.clientDetails],\n\t\t\t\t},\n\t\t\t);\n\t\t\treturn container;\n\t\t}\n\n\t\tif (this.loader === undefined) {\n\t\t\tthrow new Error(\"Cannot resolve external containers\");\n\t\t}\n\t\treturn this.loader.resolve(request);\n\t}\n}\n\n/**\n * @deprecated IFluidModuleWithDetails interface is moved to\n * {@link @fluidframework/container-definitions#IFluidModuleWithDetails}\n * to have all the code loading modules in one package. #8193\n * Encapsulates a module entry point with corresponding code details.\n * @legacy\n * @alpha\n */\nexport interface IFluidModuleWithDetails {\n\t/**\n\t * Fluid code module that implements the runtime factory needed to instantiate the container runtime.\n\t */\n\tmodule: IFluidModule;\n\t/**\n\t * Code details associated with the module. Represents a document schema this module supports.\n\t * If the code loader implements the {@link @fluidframework/core-interfaces#IFluidCodeDetailsComparer} interface,\n\t * it'll be called to determine whether the module code details satisfy the new code proposal in the quorum.\n\t */\n\tdetails: IFluidCodeDetails;\n}\n\n/**\n * @deprecated ICodeDetailsLoader interface is moved to {@link @fluidframework/container-definitions#ICodeDetailsLoader}\n * to have code loading modules in one package. #8193\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n * @legacy\n * @alpha\n */\nexport interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {\n\t/**\n\t * Load the code module (package) that is capable to interact with the document.\n\t *\n\t * @param source - Code proposal that articulates the current schema the document is written in.\n\t * @returns Code module entry point along with the code details associated with it.\n\t */\n\tload(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * Services and properties necessary for creating a loader\n * @legacy\n * @alpha\n */\nexport interface ILoaderProps {\n\t/**\n\t * The url resolver used by the loader for resolving external urls\n\t * into Fluid urls such that the container specified by the\n\t * external url can be loaded.\n\t */\n\treadonly urlResolver: IUrlResolver;\n\t/**\n\t * The document service factory take the Fluid url provided\n\t * by the resolved url and constructs all the necessary services\n\t * for communication with the container's server.\n\t */\n\treadonly documentServiceFactory: IDocumentServiceFactory;\n\t/**\n\t * The code loader handles loading the necessary code\n\t * for running a container once it is loaded.\n\t */\n\treadonly codeLoader: ICodeDetailsLoader;\n\n\t/**\n\t * A property bag of options used by various layers\n\t * to control features\n\t */\n\treadonly options?: ILoaderOptions;\n\n\t/**\n\t * Scope is provided to all container and is a set of shared\n\t * services for container's to integrate with their host environment.\n\t */\n\treadonly scope?: FluidObject;\n\n\t/**\n\t * The logger that all telemetry should be pushed to.\n\t */\n\treadonly logger?: ITelemetryBaseLogger;\n\n\t/**\n\t * The configuration provider which may be used to control features.\n\t */\n\treadonly configProvider?: IConfigProviderBase;\n\n\t/**\n\t * Optional property for allowing the container to use a custom\n\t * protocol implementation for handling the quorum and/or the audience.\n\t */\n\treadonly protocolHandlerBuilder?: ProtocolHandlerBuilder;\n}\n\n/**\n * Services and properties used by and exposed by the loader\n * @legacy\n * @alpha\n */\nexport interface ILoaderServices {\n\t/**\n\t * The url resolver used by the loader for resolving external urls\n\t * into Fluid urls such that the container specified by the\n\t * external url can be loaded.\n\t */\n\treadonly urlResolver: IUrlResolver;\n\t/**\n\t * The document service factory take the Fluid url provided\n\t * by the resolved url and constructs all the necessary services\n\t * for communication with the container's server.\n\t */\n\treadonly documentServiceFactory: IDocumentServiceFactory;\n\t/**\n\t * The code loader handles loading the necessary code\n\t * for running a container once it is loaded.\n\t */\n\treadonly codeLoader: ICodeDetailsLoader;\n\n\t/**\n\t * A property bag of options used by various layers\n\t * to control features\n\t */\n\treadonly options: ILoaderOptions;\n\n\t/**\n\t * Scope is provided to all container and is a set of shared\n\t * services for container's to integrate with their host environment.\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * The logger downstream consumers should construct their loggers from\n\t */\n\treadonly subLogger: ITelemetryLoggerExt;\n\n\t/**\n\t * Optional property for allowing the container to use a custom\n\t * protocol implementation for handling the quorum and/or the audience.\n\t */\n\treadonly protocolHandlerBuilder?: ProtocolHandlerBuilder;\n}\n\n/**\n * Manages Fluid resource loading\n * @legacy\n * @alpha\n *\n * @remarks The Loader class is deprecated and will be removed in a future release. Use the free-form functions instead (See issue #24450 for more details).\n */\nexport class Loader implements IHostLoader {\n\tpublic readonly services: ILoaderServices;\n\tprivate readonly mc: MonitoringContext;\n\n\tconstructor(loaderProps: ILoaderProps) {\n\t\tconst {\n\t\t\turlResolver,\n\t\t\tdocumentServiceFactory,\n\t\t\tcodeLoader,\n\t\t\toptions,\n\t\t\tscope,\n\t\t\tlogger,\n\t\t\tconfigProvider,\n\t\t\tprotocolHandlerBuilder,\n\t\t} = loaderProps;\n\n\t\tconst telemetryProps = {\n\t\t\tloaderId: uuid(),\n\t\t\tloaderVersion: pkgVersion,\n\t\t};\n\n\t\tconst subMc = mixinMonitoringContext(\n\t\t\tDebugLogger.mixinDebugLogger(\"fluid:telemetry\", logger, {\n\t\t\t\tall: telemetryProps,\n\t\t\t}),\n\t\t\tsessionStorageConfigProvider.value,\n\t\t\tconfigProvider,\n\t\t);\n\n\t\tthis.services = {\n\t\t\turlResolver,\n\t\t\tdocumentServiceFactory,\n\t\t\tcodeLoader,\n\t\t\toptions: options ?? {},\n\t\t\tscope:\n\t\t\t\toptions?.provideScopeLoader === false ? { ...scope } : { ...scope, ILoader: this },\n\t\t\tprotocolHandlerBuilder,\n\t\t\tsubLogger: subMc.logger,\n\t\t};\n\t\tthis.mc = createChildMonitoringContext({\n\t\t\tlogger: this.services.subLogger,\n\t\t\tnamespace: \"Loader\",\n\t\t});\n\t}\n\n\tpublic async createDetachedContainer(\n\t\tcodeDetails: IFluidCodeDetails,\n\t\tcreateDetachedProps?: {\n\t\t\tcanReconnect?: boolean;\n\t\t\tclientDetailsOverride?: IClientDetails;\n\t\t},\n\t): Promise<IContainer> {\n\t\treturn Container.createDetached(\n\t\t\t{\n\t\t\t\t...createDetachedProps,\n\t\t\t\t...this.services,\n\t\t\t},\n\t\t\tcodeDetails,\n\t\t);\n\t}\n\n\tpublic async rehydrateDetachedContainerFromSnapshot(\n\t\tsnapshot: string,\n\t\tcreateDetachedProps?: {\n\t\t\tcanReconnect?: boolean;\n\t\t\tclientDetailsOverride?: IClientDetails;\n\t\t},\n\t): Promise<IContainer> {\n\t\treturn Container.rehydrateDetachedFromSnapshot(\n\t\t\t{\n\t\t\t\t...createDetachedProps,\n\t\t\t\t...this.services,\n\t\t\t},\n\t\t\tsnapshot,\n\t\t);\n\t}\n\n\tpublic async resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer> {\n\t\tconst eventName = pendingLocalState === undefined ? \"Resolve\" : \"ResolveWithPendingState\";\n\t\treturn PerformanceEvent.timedExecAsync(this.mc.logger, { eventName }, async () => {\n\t\t\treturn this.resolveCore(\n\t\t\t\trequest,\n\t\t\t\tgetAttachedContainerStateFromSerializedContainer(pendingLocalState),\n\t\t\t);\n\t\t});\n\t}\n\n\tprivate async resolveCore(\n\t\trequest: IRequest,\n\t\tpendingLocalState?: IPendingContainerState,\n\t): Promise<Container> {\n\t\tconst resolvedAsFluid = await this.services.urlResolver.resolve(request);\n\t\tensureResolvedUrlDefined(resolvedAsFluid);\n\n\t\t// Parse URL into data stores\n\t\tconst parsed = tryParseCompatibleResolvedUrl(resolvedAsFluid.url);\n\t\tif (parsed === undefined) {\n\t\t\tthrow new Error(`Invalid URL ${resolvedAsFluid.url}`);\n\t\t}\n\n\t\tif (pendingLocalState !== undefined) {\n\t\t\tconst parsedPendingUrl = tryParseCompatibleResolvedUrl(pendingLocalState.url);\n\t\t\tif (\n\t\t\t\tparsedPendingUrl?.id !== parsed.id ||\n\t\t\t\tparsedPendingUrl?.path.replace(/\\/$/, \"\") !== parsed.path.replace(/\\/$/, \"\")\n\t\t\t) {\n\t\t\t\tconst message = `URL ${resolvedAsFluid.url} does not match pending state URL ${pendingLocalState.url}`;\n\t\t\t\tthrow new Error(message);\n\t\t\t}\n\t\t}\n\n\t\trequest.headers ??= {};\n\t\t// If set in both query string and headers, use query string. Also write the value from the query string into the header either way.\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\trequest.headers[LoaderHeader.version] =\n\t\t\tparsed.version ?? request.headers[LoaderHeader.version];\n\n\t\treturn this.loadContainer(request, resolvedAsFluid, pendingLocalState);\n\t}\n\n\tprivate async loadContainer(\n\t\trequest: IRequest,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tpendingLocalState?: IPendingContainerState,\n\t): Promise<Container> {\n\t\treturn Container.load(\n\t\t\t{\n\t\t\t\tresolvedUrl,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tversion: request.headers?.[LoaderHeader.version] ?? undefined,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tloadMode: request.headers?.[LoaderHeader.loadMode],\n\t\t\t\tpendingLocalState,\n\t\t\t},\n\t\t\t{\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tcanReconnect: request.headers?.[LoaderHeader.reconnect],\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tclientDetailsOverride: request.headers?.[LoaderHeader.clientDetails],\n\t\t\t\t...this.services,\n\t\t\t},\n\t\t);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6EASwD;AAaxD,uEAOkD;AAClD,+BAAkC;AAElC,iDAA2C;AAC3C,qDAA+C;AAC/C,2DAAiD;AAGjD,yCAGoB;AAEpB,SAAS,wBAAwB,CAChC,QAAkC;IAElC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACjD,CAAC;AACF,CAAC;AACD;;GAEG;AACH,MAAa,cAAc;IAC1B,YACkB,SAAoB,EACpB,MAA2B;QAD3B,cAAS,GAAT,SAAS,CAAW;QACpB,WAAM,GAAN,MAAM,CAAqB;IAC1C,CAAC;IAEG,KAAK,CAAC,OAAO,CAAC,OAAiB;QACrC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACjC,wBAAwB,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YACrD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAC3C;gBACC,WAAW,EAAE,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;gBAC9C,mEAAmE;gBACnE,OAAO,EAAE,OAAO,CAAC,OAAO,EA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AAC,OAAO,CAAC,IAAI,SAAS;YAC7D,mEAAmE;YACnE,QAAQ,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,uBAAY,CAAC,QAAQ,CAAC;YAClD,iBAAiB;SACjB,EACD;YACC,mEAAmE;YACnE,YAAY,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,uBAAY,CAAC,SAAS,CAAC;YACvD,mEAAmE;YACnE,qBAAqB,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,uBAAY,CAAC,aAAa,CAAC;YACpE,GAAG,IAAI,CAAC,QAAQ;SAChB,CACD,CAAC;IACH,CAAC;CACD;AA/ID,wBA+IC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype IContainer,\n\ttype IFluidCodeDetails,\n\ttype IFluidModule,\n\ttype IHostLoader,\n\ttype ILoader,\n\ttype ILoaderOptions,\n\ttype IProvideFluidCodeDetailsComparer,\n\tLoaderHeader,\n} from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIConfigProviderBase,\n\tIRequest,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type { IClientDetails } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\ttype ITelemetryLoggerExt,\n\ttype MonitoringContext,\n\tPerformanceEvent,\n\tcreateChildMonitoringContext,\n\tmixinMonitoringContext,\n\tsessionStorageConfigProvider,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport { Container } from \"./container.js\";\nimport { DebugLogger } from \"./debugLogger.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\nimport type { ProtocolHandlerBuilder } from \"./protocol.js\";\nimport type { IPendingContainerState } from \"./serializedStateManager.js\";\nimport {\n\tgetAttachedContainerStateFromSerializedContainer,\n\ttryParseCompatibleResolvedUrl,\n} from \"./utils.js\";\n\nfunction ensureResolvedUrlDefined(\n\tresolved: IResolvedUrl | undefined,\n): asserts resolved is IResolvedUrl {\n\tif (resolved === undefined) {\n\t\tthrow new Error(`Object is not a IResolveUrl.`);\n\t}\n}\n/**\n * @internal\n */\nexport class RelativeLoader implements ILoader {\n\tconstructor(\n\t\tprivate readonly container: Container,\n\t\tprivate readonly loader: ILoader | undefined,\n\t) {}\n\n\tpublic async resolve(request: IRequest): Promise<IContainer> {\n\t\tif (request.url.startsWith(\"/\")) {\n\t\t\tensureResolvedUrlDefined(this.container.resolvedUrl);\n\t\t\tconst container = await this.container.clone(\n\t\t\t\t{\n\t\t\t\t\tresolvedUrl: { ...this.container.resolvedUrl },\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\tversion: request.headers?.[LoaderHeader.version] ?? undefined,\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\tloadMode: request.headers?.[LoaderHeader.loadMode],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\tcanReconnect: request.headers?.[LoaderHeader.reconnect],\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\tclientDetailsOverride: request.headers?.[LoaderHeader.clientDetails],\n\t\t\t\t},\n\t\t\t);\n\t\t\treturn container;\n\t\t}\n\n\t\tif (this.loader === undefined) {\n\t\t\tthrow new Error(\"Cannot resolve external containers\");\n\t\t}\n\t\treturn this.loader.resolve(request);\n\t}\n}\n\n/**\n * @deprecated IFluidModuleWithDetails interface is moved to\n * {@link @fluidframework/container-definitions#IFluidModuleWithDetails}\n * to have all the code loading modules in one package. #8193\n * Encapsulates a module entry point with corresponding code details.\n * @legacy @beta\n */\nexport interface IFluidModuleWithDetails {\n\t/**\n\t * Fluid code module that implements the runtime factory needed to instantiate the container runtime.\n\t */\n\tmodule: IFluidModule;\n\t/**\n\t * Code details associated with the module. Represents a document schema this module supports.\n\t * If the code loader implements the {@link @fluidframework/core-interfaces#IFluidCodeDetailsComparer} interface,\n\t * it'll be called to determine whether the module code details satisfy the new code proposal in the quorum.\n\t */\n\tdetails: IFluidCodeDetails;\n}\n\n/**\n * @deprecated ICodeDetailsLoader interface is moved to {@link @fluidframework/container-definitions#ICodeDetailsLoader}\n * to have code loading modules in one package. #8193\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n * @legacy @beta\n */\nexport interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {\n\t/**\n\t * Load the code module (package) that is capable to interact with the document.\n\t *\n\t * @param source - Code proposal that articulates the current schema the document is written in.\n\t * @returns Code module entry point along with the code details associated with it.\n\t */\n\tload(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * Services and properties necessary for creating a loader\n * @legacy @beta\n */\nexport interface ILoaderProps {\n\t/**\n\t * The url resolver used by the loader for resolving external urls\n\t * into Fluid urls such that the container specified by the\n\t * external url can be loaded.\n\t */\n\treadonly urlResolver: IUrlResolver;\n\t/**\n\t * The document service factory take the Fluid url provided\n\t * by the resolved url and constructs all the necessary services\n\t * for communication with the container's server.\n\t */\n\treadonly documentServiceFactory: IDocumentServiceFactory;\n\t/**\n\t * The code loader handles loading the necessary code\n\t * for running a container once it is loaded.\n\t */\n\treadonly codeLoader: ICodeDetailsLoader;\n\n\t/**\n\t * A property bag of options used by various layers\n\t * to control features\n\t */\n\treadonly options?: ILoaderOptions;\n\n\t/**\n\t * Scope is provided to all container and is a set of shared\n\t * services for container's to integrate with their host environment.\n\t */\n\treadonly scope?: FluidObject;\n\n\t/**\n\t * The logger that all telemetry should be pushed to.\n\t */\n\treadonly logger?: ITelemetryBaseLogger;\n\n\t/**\n\t * The configuration provider which may be used to control features.\n\t */\n\treadonly configProvider?: IConfigProviderBase;\n\n\t/**\n\t * Optional property for allowing the container to use a custom\n\t * protocol implementation for handling the quorum and/or the audience.\n\t */\n\treadonly protocolHandlerBuilder?: ProtocolHandlerBuilder;\n}\n\n/**\n * Services and properties used by and exposed by the loader\n * @legacy @beta\n */\nexport interface ILoaderServices {\n\t/**\n\t * The url resolver used by the loader for resolving external urls\n\t * into Fluid urls such that the container specified by the\n\t * external url can be loaded.\n\t */\n\treadonly urlResolver: IUrlResolver;\n\t/**\n\t * The document service factory take the Fluid url provided\n\t * by the resolved url and constructs all the necessary services\n\t * for communication with the container's server.\n\t */\n\treadonly documentServiceFactory: IDocumentServiceFactory;\n\t/**\n\t * The code loader handles loading the necessary code\n\t * for running a container once it is loaded.\n\t */\n\treadonly codeLoader: ICodeDetailsLoader;\n\n\t/**\n\t * A property bag of options used by various layers\n\t * to control features\n\t */\n\treadonly options: ILoaderOptions;\n\n\t/**\n\t * Scope is provided to all container and is a set of shared\n\t * services for container's to integrate with their host environment.\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * The logger downstream consumers should construct their loggers from\n\t */\n\treadonly subLogger: ITelemetryLoggerExt;\n\n\t/**\n\t * Optional property for allowing the container to use a custom\n\t * protocol implementation for handling the quorum and/or the audience.\n\t */\n\treadonly protocolHandlerBuilder?: ProtocolHandlerBuilder;\n}\n\n/**\n * Manages Fluid resource loading\n * @legacy @beta\n *\n * @remarks The Loader class is deprecated and will be removed in a future release. Use the free-form functions instead (See issue #24450 for more details).\n */\nexport class Loader implements IHostLoader {\n\tpublic readonly services: ILoaderServices;\n\tprivate readonly mc: MonitoringContext;\n\n\tconstructor(loaderProps: ILoaderProps) {\n\t\tconst {\n\t\t\turlResolver,\n\t\t\tdocumentServiceFactory,\n\t\t\tcodeLoader,\n\t\t\toptions,\n\t\t\tscope,\n\t\t\tlogger,\n\t\t\tconfigProvider,\n\t\t\tprotocolHandlerBuilder,\n\t\t} = loaderProps;\n\n\t\tconst telemetryProps = {\n\t\t\tloaderId: uuid(),\n\t\t\tloaderVersion: pkgVersion,\n\t\t};\n\n\t\tconst subMc = mixinMonitoringContext(\n\t\t\tDebugLogger.mixinDebugLogger(\"fluid:telemetry\", logger, {\n\t\t\t\tall: telemetryProps,\n\t\t\t}),\n\t\t\tsessionStorageConfigProvider.value,\n\t\t\tconfigProvider,\n\t\t);\n\n\t\tthis.services = {\n\t\t\turlResolver,\n\t\t\tdocumentServiceFactory,\n\t\t\tcodeLoader,\n\t\t\toptions: options ?? {},\n\t\t\tscope:\n\t\t\t\toptions?.provideScopeLoader === false ? { ...scope } : { ...scope, ILoader: this },\n\t\t\tprotocolHandlerBuilder,\n\t\t\tsubLogger: subMc.logger,\n\t\t};\n\t\tthis.mc = createChildMonitoringContext({\n\t\t\tlogger: this.services.subLogger,\n\t\t\tnamespace: \"Loader\",\n\t\t});\n\t}\n\n\tpublic async createDetachedContainer(\n\t\tcodeDetails: IFluidCodeDetails,\n\t\tcreateDetachedProps?: {\n\t\t\tcanReconnect?: boolean;\n\t\t\tclientDetailsOverride?: IClientDetails;\n\t\t},\n\t): Promise<IContainer> {\n\t\treturn Container.createDetached(\n\t\t\t{\n\t\t\t\t...createDetachedProps,\n\t\t\t\t...this.services,\n\t\t\t},\n\t\t\tcodeDetails,\n\t\t);\n\t}\n\n\tpublic async rehydrateDetachedContainerFromSnapshot(\n\t\tsnapshot: string,\n\t\tcreateDetachedProps?: {\n\t\t\tcanReconnect?: boolean;\n\t\t\tclientDetailsOverride?: IClientDetails;\n\t\t},\n\t): Promise<IContainer> {\n\t\treturn Container.rehydrateDetachedFromSnapshot(\n\t\t\t{\n\t\t\t\t...createDetachedProps,\n\t\t\t\t...this.services,\n\t\t\t},\n\t\t\tsnapshot,\n\t\t);\n\t}\n\n\tpublic async resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer> {\n\t\tconst eventName = pendingLocalState === undefined ? \"Resolve\" : \"ResolveWithPendingState\";\n\t\treturn PerformanceEvent.timedExecAsync(this.mc.logger, { eventName }, async () => {\n\t\t\treturn this.resolveCore(\n\t\t\t\trequest,\n\t\t\t\tgetAttachedContainerStateFromSerializedContainer(pendingLocalState),\n\t\t\t);\n\t\t});\n\t}\n\n\tprivate async resolveCore(\n\t\trequest: IRequest,\n\t\tpendingLocalState?: IPendingContainerState,\n\t): Promise<Container> {\n\t\tconst resolvedAsFluid = await this.services.urlResolver.resolve(request);\n\t\tensureResolvedUrlDefined(resolvedAsFluid);\n\n\t\t// Parse URL into data stores\n\t\tconst parsed = tryParseCompatibleResolvedUrl(resolvedAsFluid.url);\n\t\tif (parsed === undefined) {\n\t\t\tthrow new Error(`Invalid URL ${resolvedAsFluid.url}`);\n\t\t}\n\n\t\tif (pendingLocalState !== undefined) {\n\t\t\tconst parsedPendingUrl = tryParseCompatibleResolvedUrl(pendingLocalState.url);\n\t\t\tif (\n\t\t\t\tparsedPendingUrl?.id !== parsed.id ||\n\t\t\t\tparsedPendingUrl?.path.replace(/\\/$/, \"\") !== parsed.path.replace(/\\/$/, \"\")\n\t\t\t) {\n\t\t\t\tconst message = `URL ${resolvedAsFluid.url} does not match pending state URL ${pendingLocalState.url}`;\n\t\t\t\tthrow new Error(message);\n\t\t\t}\n\t\t}\n\n\t\trequest.headers ??= {};\n\t\t// If set in both query string and headers, use query string. Also write the value from the query string into the header either way.\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\trequest.headers[LoaderHeader.version] =\n\t\t\tparsed.version ?? request.headers[LoaderHeader.version];\n\n\t\treturn this.loadContainer(request, resolvedAsFluid, pendingLocalState);\n\t}\n\n\tprivate async loadContainer(\n\t\trequest: IRequest,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tpendingLocalState?: IPendingContainerState,\n\t): Promise<Container> {\n\t\treturn Container.load(\n\t\t\t{\n\t\t\t\tresolvedUrl,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tversion: request.headers?.[LoaderHeader.version] ?? undefined,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tloadMode: request.headers?.[LoaderHeader.loadMode],\n\t\t\t\tpendingLocalState,\n\t\t\t},\n\t\t\t{\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tcanReconnect: request.headers?.[LoaderHeader.reconnect],\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tclientDetailsOverride: request.headers?.[LoaderHeader.clientDetails],\n\t\t\t\t...this.services,\n\t\t\t},\n\t\t);\n\t}\n}\n"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { IRequest, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { ILocationRedirectionError, IUrlResolver } from "@fluidframework/driver-definitions/internal";
|
|
5
|
+
import type { IRequest, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { type ILocationRedirectionError, type IUrlResolver } from "@fluidframework/driver-definitions/internal";
|
|
7
7
|
/**
|
|
8
8
|
* Checks if the error is location redirection error.
|
|
9
9
|
* @param error - error whose type is to be determined.
|
|
@@ -19,7 +19,7 @@ export declare function isLocationRedirectionError(error: unknown): error is ILo
|
|
|
19
19
|
* @param logger - logger to send events.
|
|
20
20
|
* @returns Response from the API call.
|
|
21
21
|
* @legacy
|
|
22
|
-
* @
|
|
22
|
+
* @beta
|
|
23
23
|
*/
|
|
24
24
|
export declare function resolveWithLocationRedirectionHandling<T>(api: (request: IRequest) => Promise<T>, request: IRequest, urlResolver: IUrlResolver, logger?: ITelemetryBaseLogger): Promise<T>;
|
|
25
25
|
//# sourceMappingURL=resolveWithLocationRedirection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveWithLocationRedirection.d.ts","sourceRoot":"","sources":["../../src/location-redirection-utilities/resolveWithLocationRedirection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"resolveWithLocationRedirection.d.ts","sourceRoot":"","sources":["../../src/location-redirection-utilities/resolveWithLocationRedirection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EACN,KAAK,yBAAyB,EAC9B,KAAK,YAAY,EAEjB,MAAM,6CAA6C,CAAC;AAGrD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACzC,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,yBAAyB,CAOpC;AAED;;;;;;;;;GASG;AACH,wBAAsB,sCAAsC,CAAC,CAAC,EAC7D,GAAG,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,EACtC,OAAO,EAAE,QAAQ,EACjB,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,GAC3B,OAAO,CAAC,CAAC,CAAC,CAmBZ"}
|
|
@@ -28,7 +28,7 @@ exports.isLocationRedirectionError = isLocationRedirectionError;
|
|
|
28
28
|
* @param logger - logger to send events.
|
|
29
29
|
* @returns Response from the API call.
|
|
30
30
|
* @legacy
|
|
31
|
-
* @
|
|
31
|
+
* @beta
|
|
32
32
|
*/
|
|
33
33
|
async function resolveWithLocationRedirectionHandling(api, request, urlResolver, logger) {
|
|
34
34
|
let req = request;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveWithLocationRedirection.js","sourceRoot":"","sources":["../../src/location-redirection-utilities/resolveWithLocationRedirection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,0EAIqD;AACrD,uEAA6E;AAE7E;;;;;GAKG;AACH,SAAgB,0BAA0B,CACzC,KAAc;IAEd,OAAO,CACN,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACb,KAA4C,CAAC,SAAS;YACtD,2BAAgB,CAAC,mBAAmB,CACrC,CAAC;AACH,CAAC;AATD,gEASC;AAED;;;;;;;;;GASG;AACI,KAAK,UAAU,sCAAsC,CAC3D,GAAsC,EACtC,OAAiB,EACjB,WAAyB,EACzB,MAA6B;IAE7B,IAAI,GAAG,GAAa,OAAO,CAAC;IAC5B,MAAM,WAAW,GAAG,IAAA,4BAAiB,EAAC,EAAE,MAAM,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC,CAAC;IACpF,SAAS,CAAC;QACT,IAAI,CAAC;YACJ,OAAO,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACzB,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,EAAE,CAAC;gBACxC,MAAM,KAAK,CAAC;YACb,CAAC;YACD,WAAW,CAAC,kBAAkB,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC,CAAC;YAC1E,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;YACtC,yGAAyG;YACzG,kGAAkG;YAClG,oCAAoC;YACpC,MAAM,WAAW,GAAG,MAAM,WAAW,CAAC,cAAc,CAAC,WAAW,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC;YACjF,GAAG,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACF,CAAC;AACF,CAAC;AAxBD,wFAwBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport {\n\
|
|
1
|
+
{"version":3,"file":"resolveWithLocationRedirection.js","sourceRoot":"","sources":["../../src/location-redirection-utilities/resolveWithLocationRedirection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,0EAIqD;AACrD,uEAA6E;AAE7E;;;;;GAKG;AACH,SAAgB,0BAA0B,CACzC,KAAc;IAEd,OAAO,CACN,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACb,KAA4C,CAAC,SAAS;YACtD,2BAAgB,CAAC,mBAAmB,CACrC,CAAC;AACH,CAAC;AATD,gEASC;AAED;;;;;;;;;GASG;AACI,KAAK,UAAU,sCAAsC,CAC3D,GAAsC,EACtC,OAAiB,EACjB,WAAyB,EACzB,MAA6B;IAE7B,IAAI,GAAG,GAAa,OAAO,CAAC;IAC5B,MAAM,WAAW,GAAG,IAAA,4BAAiB,EAAC,EAAE,MAAM,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC,CAAC;IACpF,SAAS,CAAC;QACT,IAAI,CAAC;YACJ,OAAO,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACzB,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,EAAE,CAAC;gBACxC,MAAM,KAAK,CAAC;YACb,CAAC;YACD,WAAW,CAAC,kBAAkB,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC,CAAC;YAC1E,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;YACtC,yGAAyG;YACzG,kGAAkG;YAClG,oCAAoC;YACpC,MAAM,WAAW,GAAG,MAAM,WAAW,CAAC,cAAc,CAAC,WAAW,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC;YACjF,GAAG,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACF,CAAC;AACF,CAAC;AAxBD,wFAwBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IRequest, ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport {\n\ttype ILocationRedirectionError,\n\ttype IUrlResolver,\n\tDriverErrorTypes,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { createChildLogger } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * Checks if the error is location redirection error.\n * @param error - error whose type is to be determined.\n * @returns `true` is the error is location redirection error, otherwise `false`.\n * @internal\n */\nexport function isLocationRedirectionError(\n\terror: unknown,\n): error is ILocationRedirectionError {\n\treturn (\n\t\ttypeof error === \"object\" &&\n\t\terror !== null &&\n\t\t(error as Partial<ILocationRedirectionError>).errorType ===\n\t\t\tDriverErrorTypes.locationRedirection\n\t);\n}\n\n/**\n * Handles location redirection while fulfilling the loader request.\n * @param api - Callback in which user can wrap the loader.resolve or loader.request call.\n * @param request - request to be resolved.\n * @param urlResolver - resolver used to resolve the url.\n * @param logger - logger to send events.\n * @returns Response from the API call.\n * @legacy\n * @beta\n */\nexport async function resolveWithLocationRedirectionHandling<T>(\n\tapi: (request: IRequest) => Promise<T>,\n\trequest: IRequest,\n\turlResolver: IUrlResolver,\n\tlogger?: ITelemetryBaseLogger,\n): Promise<T> {\n\tlet req: IRequest = request;\n\tconst childLogger = createChildLogger({ logger, namespace: \"LocationRedirection\" });\n\tfor (;;) {\n\t\ttry {\n\t\t\treturn await api(req);\n\t\t} catch (error: unknown) {\n\t\t\tif (!isLocationRedirectionError(error)) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tchildLogger.sendTelemetryEvent({ eventName: \"LocationRedirectionError\" });\n\t\t\tconst resolvedUrl = error.redirectUrl;\n\t\t\t// Generate the new request with new location details from the resolved url. For datastore/relative path,\n\t\t\t// we don't need to pass \"/\" as host could have asked for a specific data store. So driver need to\n\t\t\t// extract it from the resolved url.\n\t\t\tconst absoluteUrl = await urlResolver.getAbsoluteUrl(resolvedUrl, \"\", undefined);\n\t\t\treq = { url: absoluteUrl, headers: req.headers };\n\t\t}\n\t}\n}\n"]}
|
package/dist/noopHeuristic.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
6
|
-
import { IEvent } from "@fluidframework/core-interfaces";
|
|
7
|
-
import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
6
|
+
import type { IEvent } from "@fluidframework/core-interfaces";
|
|
7
|
+
import type { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
8
8
|
export interface INoopSenderEvents extends IEvent {
|
|
9
9
|
(event: "wantsNoop", listener: () => void): any;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noopHeuristic.d.ts","sourceRoot":"","sources":["../src/noopHeuristic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"noopHeuristic.d.ts","sourceRoot":"","sources":["../src/noopHeuristic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAM7F,MAAM,WAAW,iBAAkB,SAAQ,MAAM;IAChD,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,OAAE;CAC3C;AAqBD,qBAAa,aAAc,SAAQ,iBAAiB,CAAC,iBAAiB,CAAC;IAMrE,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IALpC,OAAO,CAAC,uBAAuB,CAAK;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;gBAGzC,iBAAiB,GAAE,MAAiC,EACnC,kBAAkB,GAAE,M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ChF,+DAA+D;QAC/D,sFAAsF;QACtF,yCAAyC;QACzC,IAAI,CAAC,IAAA,2BAAgB,EAAC,OAAO,CAAC,EAAE,CAAC;YAChC,OAAO;QACR,CAAC;QAED,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,uBAAuB,KAAK,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC9D,qGAAqG;YACrG,gJAAgJ;YAChJ,+FAA+F;YAC/F,cAAc,CAAC,GAAG,EAAE;gBACnB,IAAI,IAAI,CAAC,uBAAuB,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;oBAC7D,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;oBACvB,IAAA,iBAAM,EACL,IAAI,CAAC,uBAAuB,KAAK,CAAC,EAClC,KAAK,CAAC,gDAAgD,CACtD,CAAC;gBACH,CAAC;gBACD,OAAO;YACR,CAAC,CAAC,CAAC;QACJ,CAAC;QAED,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC9B,yDAAyD;YACzD,6HAA6H;YAC7H,IAAI,IAAI,CAAC,uBAAuB,KAAK,CAAC,EAAE,CAAC;gBACxC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACtB,CAAC;YAED,IAAA,iBAAM,EAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACtD,CAAC;IACF,CAAC;IAEM,gBAAgB;QACtB,2GAA2G;QAC3G,IAAI,CAAC,uBAAuB,GAAG,CAAC,CAAC;IAClC,CAAC;IAEM,iBAAiB;QACvB,6DAA6D;QAC7D,IAAI,CAAC,uBAAuB,GAAG,CAAC,CAAC;IAClC,CAAC;CACD;AArED,sCAqEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IEvent } from \"@fluidframework/core-interfaces\";\nimport { assert, Timer } from \"@fluidframework/core-utils/internal\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport { isRuntimeMessage } from \"@fluidframework/driver-utils/internal\";\n\nconst defaultNoopTimeFrequency = 2000;\nconst defaultNoopCountFrequency = 50;\n\nexport interface INoopSenderEvents extends IEvent {\n\t(event: \"wantsNoop\", listener: () => void);\n}\n\n// Here are key considerations when deciding conditions for when to send non-immediate noops:\n// 1. Sending them too often results in increase in file size and bandwidth, as well as catch up performance\n// 2. Sending too infrequently ensures that collab window is large, and as result Sequence DDS would have\n// large catchUp blobs - see Issue #6364\n// 3. Similarly, processes that rely on \"core\" snapshot (and can't parse trailing ops, including above), like search\n// parser in SPO, will result in non-accurate results due to presence of catch up blobs.\n// 4. Ordering service used 250ms timeout to coalesce non-immediate noops. It was changed to 2000 ms to allow more\n// aggressive noop sending from client side.\n// 5. Number of ops sent by all clients is proportional to number of \"write\" clients (every client sends noops),\n// but number of sequenced noops is a function of time (one op per 2 seconds at most).\n// We should consider impact to both outbound traffic (might be huge, depends on number of clients) and file size.\n// Please also see Issue #5629 for more discussions.\n//\n// With that, the current algorithm is as follows:\n// 1. Sent noop 2000 ms of receiving an op if no ops were sent by this client within this timeframe.\n// This will ensure that MSN moves forward with reasonable speed. If that results in too many sequenced noops,\n// server timeout of 2000ms should be reconsidered to be increased.\n// 2. If there are more than 50 ops received without sending any ops, send noop to keep collab window small.\n// Note that system ops (including noops themselves) are excluded, so it's 1 noop per 50 real ops.\nexport class NoopHeuristic extends TypedEventEmitter<INoopSenderEvents> {\n\tprivate opsProcessedSinceOpSent = 0;\n\tprivate readonly timer: Timer | undefined;\n\n\tconstructor(\n\t\tNoopTimeFrequency: number = defaultNoopTimeFrequency,\n\t\tprivate readonly NoopCountFrequency: number = defaultNoopCountFrequency,\n\t) {\n\t\tsuper();\n\t\tif (NoopTimeFrequency !== Number.POSITIVE_INFINITY) {\n\t\t\tthis.timer = new Timer(NoopTimeFrequency, () => {\n\t\t\t\t// We allow the timer to expire even if an op is sent or we disconnect.\n\t\t\t\t// This condition is to guard against trying to send a noop anyway in that case.\n\t\t\t\tif (this.opsProcessedSinceOpSent !== 0) {\n\t\t\t\t\tthis.emit(\"wantsNoop\");\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Schedules as ack to the server to update the reference sequence number\n\t */\n\tpublic notifyMessageProcessed(message: ISequencedDocumentMessage): void {\n\t\t// We don't acknowledge no-ops to avoid acknowledgement cycles (i.e. ack the MSN\n\t\t// update, which updates the MSN, then ack the update, etc...).\n\t\t// Intent here is for runtime (and DDSes) not to keep too much tracking state / memory\n\t\t// due to runtime ops from other clients.\n\t\tif (!isRuntimeMessage(message)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.opsProcessedSinceOpSent++;\n\t\tif (this.opsProcessedSinceOpSent === this.NoopCountFrequency) {\n\t\t\t// Wait to send a noop if we are still synchronously processing ops. This guards against two things:\n\t\t\t// 1. If we're processing many ops, we may pass the frequency threshold many times. We only need to send one noop at the very end in this case.\n\t\t\t// 2. We may send another (non-noop) op in response to processing those ops, e.g. an Accept op.\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tif (this.opsProcessedSinceOpSent >= this.NoopCountFrequency) {\n\t\t\t\t\tthis.emit(\"wantsNoop\");\n\t\t\t\t\tassert(\n\t\t\t\t\t\tthis.opsProcessedSinceOpSent === 0,\n\t\t\t\t\t\t0x243 /* \"Expected a noop to be synchronously sent\" */,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t});\n\t\t}\n\n\t\tif (this.timer !== undefined) {\n\t\t\t// Start the timer if we newly have ops that want a noop.\n\t\t\t// If the timer was already running (e.g. we surpassed the op count and sent a noop) this will reset it to its full duration.\n\t\t\tif (this.opsProcessedSinceOpSent === 1) {\n\t\t\t\tthis.timer.restart();\n\t\t\t}\n\n\t\t\tassert(this.timer.hasTimer, 0x242 /* \"has timer\" */);\n\t\t}\n\t}\n\n\tpublic notifyDisconnect(): void {\n\t\t// No need to noop for any ops processed prior to disconnect - we are already removed from MSN calculation.\n\t\tthis.opsProcessedSinceOpSent = 0;\n\t}\n\n\tpublic notifyMessageSent(): void {\n\t\t// Sending any message is as good as a noop for updating MSN.\n\t\tthis.opsProcessedSinceOpSent = 0;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"noopHeuristic.js","sourceRoot":"","sources":["../src/noopHeuristic.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAEjE,kEAAoE;AAEpE,oEAAyE;AAEzE,MAAM,wBAAwB,GAAG,IAAI,CAAC;AACtC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAMrC,6FAA6F;AAC7F,4GAA4G;AAC5G,yGAAyG;AACzG,2CAA2C;AAC3C,oHAAoH;AACpH,2FAA2F;AAC3F,kHAAkH;AAClH,+CAA+C;AAC/C,gHAAgH;AAChH,yFAAyF;AACzF,qHAAqH;AACrH,oDAAoD;AACpD,EAAE;AACF,kDAAkD;AAClD,oGAAoG;AACpG,iHAAiH;AACjH,sEAAsE;AACtE,4GAA4G;AAC5G,qGAAqG;AACrG,MAAa,aAAc,SAAQ,gCAAoC;IAItE,YACC,oBAA4B,wBAAwB,EACnC,qBAA6B,yBAAyB;QAEvE,KAAK,EAAE,CAAC;QAFS,uBAAkB,GAAlB,kBAAkB,CAAoC;QALhE,4BAAuB,GAAG,CAAC,CAAC;QAQnC,IAAI,iBAAiB,KAAK,MAAM,CAAC,iBAAiB,EAAE,CAAC;YACpD,IAAI,CAAC,KAAK,GAAG,IAAI,gBAAK,CAAC,iBAAiB,EAAE,GAAG,EAAE;gBAC9C,uEAAuE;gBACvE,gFAAgF;gBAChF,IAAI,IAAI,CAAC,uBAAuB,KAAK,CAAC,EAAE,CAAC;oBACxC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACxB,CAAC;YACF,CAAC,CAAC,CAAC;QACJ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* Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type { IEvent } from \"@fluidframework/core-interfaces\";\nimport { assert, Timer } from \"@fluidframework/core-utils/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport { isRuntimeMessage } from \"@fluidframework/driver-utils/internal\";\n\nconst defaultNoopTimeFrequency = 2000;\nconst defaultNoopCountFrequency = 50;\n\nexport interface INoopSenderEvents extends IEvent {\n\t(event: \"wantsNoop\", listener: () => void);\n}\n\n// Here are key considerations when deciding conditions for when to send non-immediate noops:\n// 1. Sending them too often results in increase in file size and bandwidth, as well as catch up performance\n// 2. Sending too infrequently ensures that collab window is large, and as result Sequence DDS would have\n// large catchUp blobs - see Issue #6364\n// 3. Similarly, processes that rely on \"core\" snapshot (and can't parse trailing ops, including above), like search\n// parser in SPO, will result in non-accurate results due to presence of catch up blobs.\n// 4. Ordering service used 250ms timeout to coalesce non-immediate noops. It was changed to 2000 ms to allow more\n// aggressive noop sending from client side.\n// 5. Number of ops sent by all clients is proportional to number of \"write\" clients (every client sends noops),\n// but number of sequenced noops is a function of time (one op per 2 seconds at most).\n// We should consider impact to both outbound traffic (might be huge, depends on number of clients) and file size.\n// Please also see Issue #5629 for more discussions.\n//\n// With that, the current algorithm is as follows:\n// 1. Sent noop 2000 ms of receiving an op if no ops were sent by this client within this timeframe.\n// This will ensure that MSN moves forward with reasonable speed. If that results in too many sequenced noops,\n// server timeout of 2000ms should be reconsidered to be increased.\n// 2. If there are more than 50 ops received without sending any ops, send noop to keep collab window small.\n// Note that system ops (including noops themselves) are excluded, so it's 1 noop per 50 real ops.\nexport class NoopHeuristic extends TypedEventEmitter<INoopSenderEvents> {\n\tprivate opsProcessedSinceOpSent = 0;\n\tprivate readonly timer: Timer | undefined;\n\n\tconstructor(\n\t\tNoopTimeFrequency: number = defaultNoopTimeFrequency,\n\t\tprivate readonly NoopCountFrequency: number = defaultNoopCountFrequency,\n\t) {\n\t\tsuper();\n\t\tif (NoopTimeFrequency !== Number.POSITIVE_INFINITY) {\n\t\t\tthis.timer = new Timer(NoopTimeFrequency, () => {\n\t\t\t\t// We allow the timer to expire even if an op is sent or we disconnect.\n\t\t\t\t// This condition is to guard against trying to send a noop anyway in that case.\n\t\t\t\tif (this.opsProcessedSinceOpSent !== 0) {\n\t\t\t\t\tthis.emit(\"wantsNoop\");\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Schedules as ack to the server to update the reference sequence number\n\t */\n\tpublic notifyMessageProcessed(message: ISequencedDocumentMessage): void {\n\t\t// We don't acknowledge no-ops to avoid acknowledgement cycles (i.e. ack the MSN\n\t\t// update, which updates the MSN, then ack the update, etc...).\n\t\t// Intent here is for runtime (and DDSes) not to keep too much tracking state / memory\n\t\t// due to runtime ops from other clients.\n\t\tif (!isRuntimeMessage(message)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.opsProcessedSinceOpSent++;\n\t\tif (this.opsProcessedSinceOpSent === this.NoopCountFrequency) {\n\t\t\t// Wait to send a noop if we are still synchronously processing ops. This guards against two things:\n\t\t\t// 1. If we're processing many ops, we may pass the frequency threshold many times. We only need to send one noop at the very end in this case.\n\t\t\t// 2. We may send another (non-noop) op in response to processing those ops, e.g. an Accept op.\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tif (this.opsProcessedSinceOpSent >= this.NoopCountFrequency) {\n\t\t\t\t\tthis.emit(\"wantsNoop\");\n\t\t\t\t\tassert(\n\t\t\t\t\t\tthis.opsProcessedSinceOpSent === 0,\n\t\t\t\t\t\t0x243 /* \"Expected a noop to be synchronously sent\" */,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t});\n\t\t}\n\n\t\tif (this.timer !== undefined) {\n\t\t\t// Start the timer if we newly have ops that want a noop.\n\t\t\t// If the timer was already running (e.g. we surpassed the op count and sent a noop) this will reset it to its full duration.\n\t\t\tif (this.opsProcessedSinceOpSent === 1) {\n\t\t\t\tthis.timer.restart();\n\t\t\t}\n\n\t\t\tassert(this.timer.hasTimer, 0x242 /* \"has timer\" */);\n\t\t}\n\t}\n\n\tpublic notifyDisconnect(): void {\n\t\t// No need to noop for any ops processed prior to disconnect - we are already removed from MSN calculation.\n\t\tthis.opsProcessedSinceOpSent = 0;\n\t}\n\n\tpublic notifyMessageSent(): void {\n\t\t// Sending any message is as good as a noop for updating MSN.\n\t\tthis.opsProcessedSinceOpSent = 0;\n\t}\n}\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -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-loader";
|
|
8
|
-
export declare const pkgVersion = "2.
|
|
8
|
+
export declare const pkgVersion = "2.61.0-355054";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,kBAAkB,CAAC"}
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/container-loader";
|
|
11
|
-
exports.pkgVersion = "2.
|
|
11
|
+
exports.pkgVersion = "2.61.0-355054";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,kCAAkC,CAAC;AAC7C,QAAA,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,kCAAkC,CAAC;AAC7C,QAAA,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-loader\";\nexport const pkgVersion = \"2.61.0-355054\";\n"]}
|
package/dist/protocol/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { IProtocolHandler as IBaseProtocolHandler, ProtocolOpHandler, IScribeProtocolState, } from "./protocol.js";
|
|
6
|
-
export { IQuorumSnapshot, Quorum, QuorumClientsSnapshot, QuorumProposalsSnapshot, } from "./quorum.js";
|
|
5
|
+
export { type IProtocolHandler as IBaseProtocolHandler, ProtocolOpHandler, type IScribeProtocolState, } from "./protocol.js";
|
|
6
|
+
export { type IQuorumSnapshot, Quorum, type QuorumClientsSnapshot, type QuorumProposalsSnapshot, } from "./quorum.js";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,IAAI,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,gBAAgB,IAAI,oBAAoB,EAC7C,iBAAiB,EACjB,KAAK,oBAAoB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,KAAK,eAAe,EACpB,MAAM,EACN,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,GAC5B,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6CAIuB;AAFtB,gHAAA,iBAAiB,OAAA;AAGlB,yCAKqB;AAHpB,mGAAA,MAAM,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6CAIuB;AAFtB,gHAAA,iBAAiB,OAAA;AAGlB,yCAKqB;AAHpB,mGAAA,MAAM,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype IProtocolHandler as IBaseProtocolHandler,\n\tProtocolOpHandler,\n\ttype IScribeProtocolState,\n} from \"./protocol.js\";\nexport {\n\ttype IQuorumSnapshot,\n\tQuorum,\n\ttype QuorumClientsSnapshot,\n\ttype QuorumProposalsSnapshot,\n} from \"./quorum.js\";\n"]}
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ISequencedClient } from "@fluidframework/driver-definitions";
|
|
6
|
-
import { ISequencedDocumentMessage, IDocumentAttributes, ICommittedProposal, IProcessMessageResult, IQuorum, ISequencedProposal } from "@fluidframework/driver-definitions/internal";
|
|
7
|
-
import { IQuorumSnapshot, Quorum } from "./quorum.js";
|
|
5
|
+
import type { ISequencedClient } from "@fluidframework/driver-definitions";
|
|
6
|
+
import { type ISequencedDocumentMessage, type IDocumentAttributes, type ICommittedProposal, type IProcessMessageResult, type IQuorum, type ISequencedProposal } from "@fluidframework/driver-definitions/internal";
|
|
7
|
+
import { type IQuorumSnapshot, Quorum } from "./quorum.js";
|
|
8
8
|
/**
|
|
9
|
-
* @legacy
|
|
10
|
-
* @alpha
|
|
9
|
+
* @legacy @beta
|
|
11
10
|
*/
|
|
12
11
|
export interface IScribeProtocolState {
|
|
13
12
|
sequenceNumber: number;
|
|
@@ -17,8 +16,7 @@ export interface IScribeProtocolState {
|
|
|
17
16
|
values: [string, ICommittedProposal][];
|
|
18
17
|
}
|
|
19
18
|
/**
|
|
20
|
-
* @legacy
|
|
21
|
-
* @alpha
|
|
19
|
+
* @legacy @beta
|
|
22
20
|
*/
|
|
23
21
|
export interface IProtocolHandler {
|
|
24
22
|
readonly quorum: IQuorum;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/protocol/protocol.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/protocol/protocol.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACN,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EAExB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAE1B,KAAK,OAAO,EAEZ,KAAK,kBAAkB,EAEvB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,E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AAM;IAKtD,IAAW,UAAU,IAAI,mBAAmB,CAK3C;IAED,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAI1E,QAAQ,IAAI,eAAe;IAIpB,KAAK,IAAI,IAAI;IAIb,cAAc,CACpB,OAAO,EAAE,yBAAyB,EAClC,KAAK,EAAE,OAAO,GACZ,qBAAqB;IAiExB;;;OAGG;IACI,gBAAgB,CAAC,aAAa,UAAQ,GAAG,oBAAoB;CAyBpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/protocol/protocol.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,0EAWqD;AAErD,
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/protocol/protocol.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,0EAWqD;AAErD,2CAA2D;AA4B3D;;;GAGG;AACH,MAAa,iBAAiB;IAE7B,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,YACQ,qBAA6B,EAC7B,cAAsB,EAC7B,OAAqC,EACrC,SAAmD,EACnD,MAAsC,EACtC,YAAqD;QAL9C,0BAAqB,GAArB,qBAAqB,CAAQ;QAC7B,mBAAc,GAAd,cAAc,CAAQ;QAM7B,IAAI,CAAC,OAAO,GAAG,IAAI,kBAAM,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IACrE,CAAC;IAED,IAAW,UAAU;QACpB,OAAO;YACN,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;YACjD,cAAc,EAAE,IAAI,CAAC,cAAc;SACnC,CAAC;IACH,CAAC;IAED,kBAAkB,CAAC,SAAkB,EAAE,QAA4B;QAClE,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC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C,CAAC;QACJ,CAAC;QAED,OAAO;YACN,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;YACjD,GAAG,QAAQ;SACX,CAAC;IACH,CAAC;CACD;AArID,8CAqIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ISequencedClient } from \"@fluidframework/driver-definitions\";\nimport {\n\ttype ISequencedDocumentMessage,\n\ttype IDocumentAttributes,\n\ttype IClientJoin,\n\ttype ICommittedProposal,\n\ttype IProcessMessageResult,\n\ttype IProposal,\n\ttype IQuorum,\n\ttype ISequencedDocumentSystemMessage,\n\ttype ISequencedProposal,\n\tMessageType,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport { type IQuorumSnapshot, Quorum } from \"./quorum.js\";\n\n/**\n * @legacy @beta\n */\nexport interface IScribeProtocolState {\n\tsequenceNumber: number;\n\tminimumSequenceNumber: number;\n\tmembers: [string, ISequencedClient][];\n\tproposals: [number, ISequencedProposal, string[]][];\n\tvalues: [string, ICommittedProposal][];\n}\n\n/**\n * @legacy @beta\n */\nexport interface IProtocolHandler {\n\treadonly quorum: IQuorum;\n\treadonly attributes: IDocumentAttributes;\n\n\tsetConnectionState(connected: boolean, clientId: string | undefined);\n\tsnapshot(): IQuorumSnapshot;\n\n\tclose(): void;\n\tprocessMessage(message: ISequencedDocumentMessage, local: boolean): IProcessMessageResult;\n\tgetProtocolState(): IScribeProtocolState;\n}\n\n/**\n * Handles protocol specific ops.\n * @internal\n */\nexport class ProtocolOpHandler implements IProtocolHandler {\n\tprivate readonly _quorum: Quorum;\n\tpublic get quorum(): Quorum {\n\t\treturn this._quorum;\n\t}\n\n\tconstructor(\n\t\tpublic minimumSequenceNumber: number,\n\t\tpublic sequenceNumber: number,\n\t\tmembers: [string, ISequencedClient][],\n\t\tproposals: [number, ISequencedProposal, string[]][],\n\t\tvalues: [string, ICommittedProposal][],\n\t\tsendProposal: (key: string, value: unknown) => number,\n\t) {\n\t\tthis._quorum = new Quorum(members, proposals, values, sendProposal);\n\t}\n\n\tpublic get attributes(): IDocumentAttributes {\n\t\treturn {\n\t\t\tminimumSequenceNumber: this.minimumSequenceNumber,\n\t\t\tsequenceNumber: this.sequenceNumber,\n\t\t};\n\t}\n\n\tsetConnectionState(connected: boolean, clientId: string | undefined): void {\n\t\tthis._quorum.setConnectionState(connected, clientId);\n\t}\n\n\tsnapshot(): IQuorumSnapshot {\n\t\treturn this._quorum.snapshot();\n\t}\n\n\tpublic close(): void {\n\t\tthis._quorum.close();\n\t}\n\n\tpublic processMessage(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t): IProcessMessageResult {\n\t\t// verify it's moving sequentially\n\t\tif (message.sequenceNumber !== this.sequenceNumber + 1) {\n\t\t\tthrow new Error(\n\t\t\t\t`Protocol state is not moving sequentially. ` +\n\t\t\t\t\t`Current is ${this.sequenceNumber}. Next is ${message.sequenceNumber}`,\n\t\t\t);\n\t\t}\n\n\t\t// Update tracked sequence numbers\n\t\tthis.sequenceNumber = message.sequenceNumber;\n\t\tthis.minimumSequenceNumber = message.minimumSequenceNumber;\n\n\t\tlet immediateNoOp = false;\n\n\t\tswitch (message.type) {\n\t\t\tcase MessageType.ClientJoin: {\n\t\t\t\tconst systemJoinMessage = message as ISequencedDocumentSystemMessage;\n\t\t\t\tconst join = JSON.parse(systemJoinMessage.data) as IClientJoin;\n\t\t\t\tconst member: ISequencedClient = {\n\t\t\t\t\tclient: join.detail,\n\t\t\t\t\tsequenceNumber: systemJoinMessage.sequenceNumber,\n\t\t\t\t};\n\t\t\t\tthis._quorum.addMember(join.clientId, member);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase MessageType.ClientLeave: {\n\t\t\t\tconst systemLeaveMessage = message as ISequencedDocumentSystemMessage;\n\t\t\t\tconst clientId = JSON.parse(systemLeaveMessage.data) as string;\n\t\t\t\tthis._quorum.removeMember(clientId);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase MessageType.Propose: {\n\t\t\t\t// DeltaManager is no longer parsing the contents, so we expect this to be a string here\n\t\t\t\t// (However, switching this to an assert caused some tests to fail, apparently due to the same\n\t\t\t\t// message object being processed multiple times - So we will retain the typeof check for now)\n\t\t\t\tif (typeof message.contents === \"string\") {\n\t\t\t\t\tmessage.contents = JSON.parse(message.contents);\n\t\t\t\t}\n\t\t\t\tconst proposal = message.contents as IProposal;\n\t\t\t\tthis._quorum.addProposal(\n\t\t\t\t\tproposal.key,\n\t\t\t\t\tproposal.value,\n\t\t\t\t\tmessage.sequenceNumber,\n\t\t\t\t\tlocal,\n\t\t\t\t\tmessage.clientSequenceNumber,\n\t\t\t\t);\n\n\t\t\t\t// On a quorum proposal, immediately send a response to expedite the approval.\n\t\t\t\timmediateNoOp = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdefault:\n\t\t}\n\n\t\t// Notify the quorum of the MSN from the message. We rely on it to handle duplicate values but may\n\t\t// want to move that logic to this class.\n\t\tthis._quorum.updateMinimumSequenceNumber(message);\n\n\t\treturn { immediateNoOp };\n\t}\n\n\t/**\n\t * Gets the scribe protocol state\n\t * @param scrubUserData - whether to remove all user data from the quorum members. CAUTION: this will corrupt the quorum if used in a summary.\n\t */\n\tpublic getProtocolState(scrubUserData = false): IScribeProtocolState {\n\t\t// return a new object every time\n\t\t// this ensures future state changes will not affect outside callers\n\t\tconst snapshot = this._quorum.snapshot();\n\n\t\tif (scrubUserData) {\n\t\t\t// In place, remove any identifying client information\n\t\t\tsnapshot.members = snapshot.members.map(([id, sequencedClient]) => [\n\t\t\t\tid,\n\t\t\t\t{\n\t\t\t\t\t...sequencedClient,\n\t\t\t\t\tclient: {\n\t\t\t\t\t\t...sequencedClient.client,\n\t\t\t\t\t\tuser: { id: \"\" },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]);\n\t\t}\n\n\t\treturn {\n\t\t\tsequenceNumber: this.sequenceNumber,\n\t\t\tminimumSequenceNumber: this.minimumSequenceNumber,\n\t\t\t...snapshot,\n\t\t};\n\t}\n}\n"]}
|
|
@@ -3,18 +3,16 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
6
|
-
import { IQuorumClients, ISequencedClient } from "@fluidframework/driver-definitions";
|
|
7
|
-
import { ISequencedDocumentMessage, ICommittedProposal, IQuorum, IQuorumProposals, ISequencedProposal } from "@fluidframework/driver-definitions/internal";
|
|
6
|
+
import type { IQuorumClients, ISequencedClient } from "@fluidframework/driver-definitions";
|
|
7
|
+
import type { ISequencedDocumentMessage, ICommittedProposal, IQuorum, IQuorumProposals, ISequencedProposal } from "@fluidframework/driver-definitions/internal";
|
|
8
8
|
/**
|
|
9
9
|
* Snapshot format for a QuorumClients
|
|
10
|
-
* @legacy
|
|
11
|
-
* @alpha
|
|
10
|
+
* @legacy @beta
|
|
12
11
|
*/
|
|
13
12
|
export type QuorumClientsSnapshot = [string, ISequencedClient][];
|
|
14
13
|
/**
|
|
15
14
|
* Snapshot format for a QuorumProposals
|
|
16
|
-
* @legacy
|
|
17
|
-
* @alpha
|
|
15
|
+
* @legacy @beta
|
|
18
16
|
*/
|
|
19
17
|
export type QuorumProposalsSnapshot = {
|
|
20
18
|
proposals: [number, ISequencedProposal, string[]][];
|
|
@@ -22,8 +20,7 @@ export type QuorumProposalsSnapshot = {
|
|
|
22
20
|
};
|
|
23
21
|
/**
|
|
24
22
|
* Snapshot format for a Quorum
|
|
25
|
-
* @legacy
|
|
26
|
-
* @alpha
|
|
23
|
+
* @legacy @beta
|
|
27
24
|
*/
|
|
28
25
|
export interface IQuorumSnapshot {
|
|
29
26
|
members: QuorumClientsSnapshot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quorum.d.ts","sourceRoot":"","sources":["../../src/protocol/quorum.ts"],"names":[],"mappings":"AAAA;;;G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