@fluidframework/container-loader 2.0.2 → 2.1.0-276326
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +2 -5
- package/api-extractor/api-extractor.legacy.json +4 -0
- package/api-report/container-loader.beta.api.md +0 -27
- package/api-report/{container-loader.alpha.api.md → container-loader.legacy.alpha.api.md} +0 -27
- package/api-report/container-loader.public.api.md +0 -27
- package/dist/attachment.d.ts +2 -1
- package/dist/attachment.d.ts.map +1 -1
- package/dist/attachment.js.map +1 -1
- package/dist/audience.d.ts.map +1 -1
- package/dist/audience.js +4 -4
- package/dist/audience.js.map +1 -1
- package/dist/catchUpMonitor.d.ts +15 -4
- package/dist/catchUpMonitor.d.ts.map +1 -1
- package/dist/catchUpMonitor.js +12 -3
- package/dist/catchUpMonitor.js.map +1 -1
- package/dist/connectionManager.d.ts +24 -8
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js +36 -23
- package/dist/connectionManager.js.map +1 -1
- package/dist/connectionStateHandler.d.ts +30 -20
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/connectionStateHandler.js +15 -11
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts +7 -2
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +45 -28
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts +8 -4
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js +3 -1
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +1 -1
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js +12 -6
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/contracts.d.ts +17 -8
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +4 -2
- package/dist/contracts.js.map +1 -1
- package/dist/debugLogger.js +3 -3
- package/dist/debugLogger.js.map +1 -1
- package/dist/deltaManager.d.ts +13 -9
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js +32 -23
- package/dist/deltaManager.js.map +1 -1
- package/dist/deltaQueue.d.ts +1 -4
- package/dist/deltaQueue.d.ts.map +1 -1
- package/dist/deltaQueue.js +2 -2
- 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.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/legacy.d.ts +1 -1
- package/dist/loadPaused.d.ts +2 -2
- package/dist/loadPaused.d.ts.map +1 -1
- package/dist/loadPaused.js +7 -3
- package/dist/loadPaused.js.map +1 -1
- package/dist/loader.d.ts +10 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +11 -1
- package/dist/loader.js.map +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts +2 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.js +3 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
- package/dist/memoryBlobStorage.d.ts.map +1 -1
- package/dist/memoryBlobStorage.js +4 -2
- package/dist/memoryBlobStorage.js.map +1 -1
- package/dist/noopHeuristic.js +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/protocol.d.ts +4 -3
- package/dist/protocol/protocol.d.ts.map +1 -1
- package/dist/protocol/protocol.js +6 -5
- package/dist/protocol/protocol.js.map +1 -1
- package/dist/protocol/quorum.d.ts +11 -8
- package/dist/protocol/quorum.d.ts.map +1 -1
- package/dist/protocol/quorum.js +8 -8
- package/dist/protocol/quorum.js.map +1 -1
- package/dist/protocol.d.ts +2 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +7 -2
- package/dist/protocol.js.map +1 -1
- package/dist/protocolTreeDocumentStorageService.d.ts +2 -2
- package/dist/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/dist/protocolTreeDocumentStorageService.js.map +1 -1
- package/dist/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/retriableDocumentStorageService.js +4 -1
- package/dist/retriableDocumentStorageService.js.map +1 -1
- package/dist/serializedStateManager.d.ts +29 -12
- package/dist/serializedStateManager.d.ts.map +1 -1
- package/dist/serializedStateManager.js +55 -24
- package/dist/serializedStateManager.js.map +1 -1
- package/dist/utils.d.ts +4 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +15 -6
- package/dist/utils.js.map +1 -1
- package/lib/attachment.d.ts +2 -1
- package/lib/attachment.d.ts.map +1 -1
- package/lib/attachment.js.map +1 -1
- package/lib/audience.d.ts.map +1 -1
- package/lib/audience.js +4 -4
- package/lib/audience.js.map +1 -1
- package/lib/catchUpMonitor.d.ts +15 -4
- package/lib/catchUpMonitor.d.ts.map +1 -1
- package/lib/catchUpMonitor.js +12 -3
- package/lib/catchUpMonitor.js.map +1 -1
- package/lib/connectionManager.d.ts +24 -8
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +36 -23
- package/lib/connectionManager.js.map +1 -1
- package/lib/connectionStateHandler.d.ts +30 -20
- package/lib/connectionStateHandler.d.ts.map +1 -1
- package/lib/connectionStateHandler.js +14 -12
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts +7 -2
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +45 -28
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts +8 -4
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js +3 -1
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +1 -1
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js +12 -6
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/contracts.d.ts +17 -8
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contracts.js +4 -2
- package/lib/contracts.js.map +1 -1
- package/lib/debugLogger.js +3 -3
- package/lib/debugLogger.js.map +1 -1
- package/lib/deltaManager.d.ts +13 -9
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js +32 -23
- package/lib/deltaManager.js.map +1 -1
- package/lib/deltaQueue.d.ts +1 -4
- package/lib/deltaQueue.d.ts.map +1 -1
- package/lib/deltaQueue.js +2 -2
- 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.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/loadPaused.d.ts +2 -2
- package/lib/loadPaused.d.ts.map +1 -1
- package/lib/loadPaused.js +8 -4
- package/lib/loadPaused.js.map +1 -1
- package/lib/loader.d.ts +10 -1
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js +11 -1
- package/lib/loader.js.map +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts +2 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.js +3 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
- package/lib/memoryBlobStorage.d.ts.map +1 -1
- package/lib/memoryBlobStorage.js +4 -2
- package/lib/memoryBlobStorage.js.map +1 -1
- package/lib/noopHeuristic.js +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/protocol.d.ts +4 -3
- package/lib/protocol/protocol.d.ts.map +1 -1
- package/lib/protocol/protocol.js +6 -5
- package/lib/protocol/protocol.js.map +1 -1
- package/lib/protocol/quorum.d.ts +11 -8
- package/lib/protocol/quorum.d.ts.map +1 -1
- package/lib/protocol/quorum.js +8 -8
- package/lib/protocol/quorum.js.map +1 -1
- package/lib/protocol.d.ts +2 -0
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +7 -2
- package/lib/protocol.js.map +1 -1
- package/lib/protocolTreeDocumentStorageService.d.ts +2 -2
- package/lib/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/lib/protocolTreeDocumentStorageService.js.map +1 -1
- package/lib/retriableDocumentStorageService.d.ts.map +1 -1
- package/lib/retriableDocumentStorageService.js +4 -1
- package/lib/retriableDocumentStorageService.js.map +1 -1
- package/lib/serializedStateManager.d.ts +29 -12
- package/lib/serializedStateManager.d.ts.map +1 -1
- package/lib/serializedStateManager.js +56 -25
- package/lib/serializedStateManager.js.map +1 -1
- package/lib/utils.d.ts +4 -2
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +16 -7
- package/lib/utils.js.map +1 -1
- package/package.json +21 -17
- package/src/attachment.ts +2 -1
- package/src/audience.ts +4 -4
- package/src/catchUpMonitor.ts +23 -8
- package/src/connectionManager.ts +85 -60
- package/src/connectionStateHandler.ts +85 -63
- package/src/container.ts +118 -84
- package/src/containerContext.ts +5 -3
- package/src/containerStorageAdapter.ts +20 -13
- package/src/contracts.ts +21 -9
- package/src/debugLogger.ts +4 -4
- package/src/deltaManager.ts +75 -56
- package/src/deltaQueue.ts +16 -10
- package/src/disposal.ts +3 -3
- package/src/error.ts +2 -1
- package/src/loadPaused.ts +16 -8
- package/src/loader.ts +20 -2
- package/src/location-redirection-utilities/resolveWithLocationRedirection.ts +7 -3
- package/src/memoryBlobStorage.ts +5 -3
- package/src/noopHeuristic.ts +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/protocol/protocol.ts +12 -11
- package/src/protocol/quorum.ts +49 -40
- package/src/protocol.ts +12 -4
- package/src/protocolTreeDocumentStorageService.ts +3 -2
- package/src/retriableDocumentStorageService.ts +6 -3
- package/src/serializedStateManager.ts +95 -39
- package/src/utils.ts +26 -10
package/lib/disposal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disposal.js","sourceRoot":"","sources":["../src/disposal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC9B,UAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"disposal.js","sourceRoot":"","sources":["../src/disposal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC9B,UAAuB,EACvB,CAA4B;IAE5B,OAAO,CAAC,GAAG,IAAe,EAAK,EAAE;QAChC,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACrC,CAAC;aAAM,CAAC;YACP,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;QACnB,CAAC;IACF,CAAC,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable } from \"@fluidframework/core-interfaces\";\n\n/**\n * Returns a wrapper around the provided function, which will only invoke the inner function if the provided\n * {@link @fluidframework/core-interfaces#IDisposable | disposable} object has not yet been disposed.\n *\n * @throws Will throw an error if the item has already been disposed.\n */\nexport function doIfNotDisposed<T>(\n\tdisposable: IDisposable,\n\tf: (...args: unknown[]) => T,\n): (...args: unknown[]) => T {\n\treturn (...args: unknown[]): T => {\n\t\tif (disposable.disposed) {\n\t\t\tthrow new Error(\"Already disposed\");\n\t\t} else {\n\t\t\treturn f(...args);\n\t\t}\n\t};\n}\n"]}
|
package/lib/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EACN,eAAe,EACf,mBAAmB,EACnB,YAAY,EAEZ,MAAM,0CAA0C,CAAC;AAElD;;GAEG;AACH,qBAAa,iBACZ,SAAQ,YACR,YAAW,kBAAkB,EAAE,eAAe;IAS7C,QAAQ,CAAC,iBAAiB,EAAE,MAAM;IAPnC;;OAEG;IACH,SAAgB,SAAS,oBAAuC;IAEhE,OAAO;IAQP;;;OAGG;WACW,IAAI,CACjB,KAAK,EAAE,OAAO,EACd,iBAAiB,EAAE,MAAM,EACzB,MAAM,EAAE,mBAAmB,GACzB,kBAAkB;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EACN,eAAe,EACf,mBAAmB,EACnB,YAAY,EAEZ,MAAM,0CAA0C,CAAC;AAElD;;GAEG;AACH,qBAAa,iBACZ,SAAQ,YACR,YAAW,kBAAkB,EAAE,eAAe;IAS7C,QAAQ,CAAC,iBAAiB,EAAE,MAAM;IAPnC;;OAEG;IACH,SAAgB,SAAS,oBAAuC;IAEhE,OAAO;IAQP;;;OAGG;WACW,IAAI,CACjB,KAAK,EAAE,OAAO,EACd,iBAAiB,EAAE,MAAM,EACzB,MAAM,EAAE,mBAAmB,GACzB,kBAAkB;CAKrB"}
|
package/lib/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAGrF,OAAO,EAGN,YAAY,EACZ,eAAe,GACf,MAAM,0CAA0C,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,iBACZ,SAAQ,YAAY;IAQpB,YACC,OAAe,EACN,iBAAyB,EAClC,KAAgC;QAEhC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAHb,sBAAiB,GAAjB,iBAAiB,CAAQ;QAPnC;;WAEG;QACa,cAAS,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAQhE,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,IAAI,CACjB,KAAc,EACd,iBAAyB,EACzB,MAA2B;QAE3B,MAAM,UAAU,GAAG,CAAC,MAAc,
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAGrF,OAAO,EAGN,YAAY,EACZ,eAAe,GACf,MAAM,0CAA0C,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,iBACZ,SAAQ,YAAY;IAQpB,YACC,OAAe,EACN,iBAAyB,EAClC,KAAgC;QAEhC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAHb,sBAAiB,GAAjB,iBAAiB,CAAQ;QAPnC;;WAEG;QACa,cAAS,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAQhE,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,IAAI,CACjB,KAAc,EACd,iBAAyB,EACzB,MAA2B;QAE3B,MAAM,UAAU,GAAG,CAAC,MAAc,EAAqB,EAAE,CACxD,IAAI,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;QAClD,OAAO,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ContainerErrorTypes } from \"@fluidframework/container-definitions/internal\";\nimport { ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport { IThrottlingWarning } from \"@fluidframework/core-interfaces/internal\";\nimport {\n\tIFluidErrorBase,\n\tITelemetryLoggerExt,\n\tLoggingError,\n\twrapErrorAndLog,\n} from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * Warning emitted when requests to storage are being throttled.\n */\nexport class ThrottlingWarning\n\textends LoggingError\n\timplements IThrottlingWarning, IFluidErrorBase\n{\n\t/**\n\t * {@inheritDoc @fluidframework/telemetry-utils#IFluidErrorBase.errorType}\n\t */\n\tpublic readonly errorType = ContainerErrorTypes.throttlingError;\n\n\tprivate constructor(\n\t\tmessage: string,\n\t\treadonly retryAfterSeconds: number,\n\t\tprops?: ITelemetryBaseProperties,\n\t) {\n\t\tsuper(message, props);\n\t}\n\n\t/**\n\t * Wrap the given error as a ThrottlingWarning\n\t * Only preserves the error message, and applies the given retry after to the new warning object\n\t */\n\tpublic static wrap(\n\t\terror: unknown,\n\t\tretryAfterSeconds: number,\n\t\tlogger: ITelemetryLoggerExt,\n\t): IThrottlingWarning {\n\t\tconst newErrorFn = (errMsg: string): ThrottlingWarning =>\n\t\t\tnew ThrottlingWarning(errMsg, retryAfterSeconds);\n\t\treturn wrapErrorAndLog(error, newErrorFn, logger);\n\t}\n}\n"]}
|
package/lib/legacy.d.ts
CHANGED
package/lib/loadPaused.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ILoader } from "@fluidframework/container-definitions/internal";
|
|
5
|
+
import { ILoader, type IContainer } from "@fluidframework/container-definitions/internal";
|
|
6
6
|
import { IRequest } from "@fluidframework/core-interfaces";
|
|
7
7
|
/**
|
|
8
8
|
* Loads container and leaves it in a state where it does not process any ops.
|
|
@@ -31,5 +31,5 @@ import { IRequest } from "@fluidframework/core-interfaces";
|
|
|
31
31
|
*
|
|
32
32
|
* @internal
|
|
33
33
|
*/
|
|
34
|
-
export declare function loadContainerPaused(loader: ILoader, request: IRequest, loadToSequenceNumber?: number, signal?: AbortSignal): Promise<
|
|
34
|
+
export declare function loadContainerPaused(loader: ILoader, request: IRequest, loadToSequenceNumber?: number, signal?: AbortSignal): Promise<IContainer>;
|
|
35
35
|
//# sourceMappingURL=loadPaused.d.ts.map
|
package/lib/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,
|
|
1
|
+
{"version":3,"file":"loadPaused.d.ts","sourceRoot":"","sources":["../src/loadPaused.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,OAAO,EAEP,KAAK,UAAU,EACf,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAM3D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,mBAAmB,CACxC,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,EACjB,oBAAoB,CAAC,EAAE,MAAM,EAC7B,MAAM,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,UAAU,CAAC,CAiGrB"}
|
package/lib/loadPaused.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { LoaderHeader } from "@fluidframework/container-definitions/internal";
|
|
5
|
+
import { LoaderHeader, } from "@fluidframework/container-definitions/internal";
|
|
6
6
|
import { GenericError } from "@fluidframework/telemetry-utils/internal";
|
|
7
7
|
/* eslint-disable jsdoc/check-indentation */
|
|
8
8
|
/**
|
|
@@ -46,7 +46,9 @@ export async function loadContainerPaused(loader, request, loadToSequenceNumber,
|
|
|
46
46
|
const dm = container.deltaManager;
|
|
47
47
|
const lastProcessedSequenceNumber = dm.initialSequenceNumber;
|
|
48
48
|
const pauseContainer = () => {
|
|
49
|
+
// eslint-disable-next-line no-void
|
|
49
50
|
void dm.inbound.pause();
|
|
51
|
+
// eslint-disable-next-line no-void
|
|
50
52
|
void dm.outbound.pause();
|
|
51
53
|
};
|
|
52
54
|
// Happy path - we are already there.
|
|
@@ -65,9 +67,9 @@ export async function loadContainerPaused(loader, request, loadToSequenceNumber,
|
|
|
65
67
|
let opHandler;
|
|
66
68
|
let onAbort;
|
|
67
69
|
let onClose;
|
|
68
|
-
const promise = new Promise((resolve,
|
|
69
|
-
onAbort = () =>
|
|
70
|
-
onClose = (error) =>
|
|
70
|
+
const promise = new Promise((resolve, reject) => {
|
|
71
|
+
onAbort = () => reject(new GenericError("Canceled due to cancellation request."));
|
|
72
|
+
onClose = (error) => reject(error);
|
|
71
73
|
// We need to setup a listener to stop op processing once we reach the desired sequence number (if specified).
|
|
72
74
|
opHandler = () => {
|
|
73
75
|
// If there is a specified sequence number, keep processing until we reach it.
|
|
@@ -92,7 +94,9 @@ export async function loadContainerPaused(loader, request, loadToSequenceNumber,
|
|
|
92
94
|
container.connect();
|
|
93
95
|
// Wait for the ops to be processed.
|
|
94
96
|
await promise
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
95
98
|
.catch((error) => {
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
96
100
|
container.close(error);
|
|
97
101
|
throw error;
|
|
98
102
|
})
|
package/lib/loadPaused.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadPaused.js","sourceRoot":"","sources":["../src/loadPaused.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"loadPaused.js","sourceRoot":"","sources":["../src/loadPaused.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,YAAY,GAEZ,MAAM,gDAAgD,CAAC;AAGxD,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAA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,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;AAED,2CAA2C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tILoader,\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 { GenericError } from \"@fluidframework/telemetry-utils/internal\";\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 loader - loader instance to use to load 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\tloader: ILoader,\n\trequest: IRequest,\n\tloadToSequenceNumber?: number,\n\tsignal?: AbortSignal,\n): Promise<IContainer> {\n\tconst container = await loader.resolve({\n\t\turl: request.url,\n\t\theaders: {\n\t\t\t...request.headers,\n\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[LoaderHeader.loadMode]: { opsBeforeReturn: undefined, deltaConnection: \"none\" },\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\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/lib/loader.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare class RelativeLoader implements ILoader {
|
|
|
19
19
|
resolve(request: IRequest): Promise<IContainer>;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
+
* @legacy
|
|
22
23
|
* @alpha
|
|
23
24
|
*/
|
|
24
25
|
export interface ILoaderOptions extends ILoaderOptions1 {
|
|
@@ -29,10 +30,13 @@ export interface ILoaderOptions extends ILoaderOptions1 {
|
|
|
29
30
|
* {@link @fluidframework/container-definitions#IFluidModuleWithDetails}
|
|
30
31
|
* to have all the code loading modules in one package. #8193
|
|
31
32
|
* Encapsulates a module entry point with corresponding code details.
|
|
33
|
+
* @legacy
|
|
32
34
|
* @alpha
|
|
33
35
|
*/
|
|
34
36
|
export interface IFluidModuleWithDetails {
|
|
35
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Fluid code module that implements the runtime factory needed to instantiate the container runtime.
|
|
39
|
+
*/
|
|
36
40
|
module: IFluidModule;
|
|
37
41
|
/**
|
|
38
42
|
* Code details associated with the module. Represents a document schema this module supports.
|
|
@@ -46,6 +50,7 @@ export interface IFluidModuleWithDetails {
|
|
|
46
50
|
* to have code loading modules in one package. #8193
|
|
47
51
|
* Fluid code loader resolves a code module matching the document schema, i.e. code details, such as
|
|
48
52
|
* a package name and package version range.
|
|
53
|
+
* @legacy
|
|
49
54
|
* @alpha
|
|
50
55
|
*/
|
|
51
56
|
export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {
|
|
@@ -59,6 +64,7 @@ export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComp
|
|
|
59
64
|
}
|
|
60
65
|
/**
|
|
61
66
|
* Services and properties necessary for creating a loader
|
|
67
|
+
* @legacy
|
|
62
68
|
* @alpha
|
|
63
69
|
*/
|
|
64
70
|
export interface ILoaderProps {
|
|
@@ -109,6 +115,7 @@ export interface ILoaderProps {
|
|
|
109
115
|
}
|
|
110
116
|
/**
|
|
111
117
|
* Services and properties used by and exposed by the loader
|
|
118
|
+
* @legacy
|
|
112
119
|
* @alpha
|
|
113
120
|
*/
|
|
114
121
|
export interface ILoaderServices {
|
|
@@ -157,6 +164,7 @@ export interface ILoaderServices {
|
|
|
157
164
|
/**
|
|
158
165
|
* Subset of IDocumentStorageService which only supports createBlob() and readBlob(). This is used to support
|
|
159
166
|
* blobs in detached containers.
|
|
167
|
+
* @legacy
|
|
160
168
|
* @alpha
|
|
161
169
|
*
|
|
162
170
|
* @deprecated - IDetachedBlobStorage will be removed in a future release without a replacement. Blobs created while detached will be stored in memory to align with attached container behavior. AB#8049
|
|
@@ -174,6 +182,7 @@ export type IDetachedBlobStorage = Pick<IDocumentStorageService, "createBlob" |
|
|
|
174
182
|
};
|
|
175
183
|
/**
|
|
176
184
|
* Manages Fluid resource loading
|
|
185
|
+
* @legacy
|
|
177
186
|
* @alpha
|
|
178
187
|
*/
|
|
179
188
|
export declare class Loader implements IHostLoader {
|
package/lib/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,EACV,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,OAAO,EACP,cAAc,IAAI,eAAe,EACjC,gCAAgC,EAEhC,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACN,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EACN,uBAAuB,EACvB,uBAAuB,EAEvB,YAAY,EACZ,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACN,mBAAmB,EAMnB,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAcvD;;GAEG;AACH,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H,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IAExC;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,oBAAoB,CAAC;IAEpD;;;OAGG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CACzD;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,uBAAuB,EAAE,YAAY,GAAG,UAAU,CAAC,GAAG;IAC7F,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,IAAI,MAAM,EAAE,CAAC;IAEvB;;OAEG;IACH,OAAO,CAAC,IAAI,IAAI,CAAC;CACjB,CAAC;AAEF;;;;GAIG;AACH,qBAAa,MAAO,YAAW,WAAW;IACzC,SAAgB,QAAQ,EAAE,eAAe,CAAC;IAC1C,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAoB;gBAE3B,WAAW,EAAE,YAAY;IA2CxB,uBAAuB,CACnC,WAAW,EAAE,iBAAiB,EAC9B,mBAAmB,CAAC,EAAE;QACrB,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,qBAAqB,CAAC,EAAE,cAAc,CAAC;KACvC,GACC,OAAO,CAAC,UAAU,CAAC;IAUT,sCAAsC,CAClD,QAAQ,EAAE,MAAM,EAChB,mBAAmB,CAAC,EAAE;QACrB,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,qBAAqB,CAAC,EAAE,cAAc,CAAC;KACvC,GACC,OAAO,CAAC,UAAU,CAAC;IAUT,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;YAU1E,WAAW;YAiCX,aAAa;CAuB3B"}
|
package/lib/loader.js
CHANGED
|
@@ -27,10 +27,14 @@ export class RelativeLoader {
|
|
|
27
27
|
ensureResolvedUrlDefined(this.container.resolvedUrl);
|
|
28
28
|
const container = await this.container.clone({
|
|
29
29
|
resolvedUrl: { ...this.container.resolvedUrl },
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
30
31
|
version: request.headers?.[LoaderHeader.version] ?? undefined,
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
31
33
|
loadMode: request.headers?.[LoaderHeader.loadMode],
|
|
32
34
|
}, {
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
33
36
|
canReconnect: request.headers?.[LoaderHeader.reconnect],
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
34
38
|
clientDetailsOverride: request.headers?.[LoaderHeader.clientDetails],
|
|
35
39
|
});
|
|
36
40
|
return container;
|
|
@@ -43,6 +47,7 @@ export class RelativeLoader {
|
|
|
43
47
|
}
|
|
44
48
|
/**
|
|
45
49
|
* Manages Fluid resource loading
|
|
50
|
+
* @legacy
|
|
46
51
|
* @alpha
|
|
47
52
|
*/
|
|
48
53
|
export class Loader {
|
|
@@ -60,7 +65,7 @@ export class Loader {
|
|
|
60
65
|
documentServiceFactory,
|
|
61
66
|
codeLoader,
|
|
62
67
|
options: options ?? {},
|
|
63
|
-
scope: options?.provideScopeLoader
|
|
68
|
+
scope: options?.provideScopeLoader === false ? { ...scope } : { ...scope, ILoader: this },
|
|
64
69
|
detachedBlobStorage,
|
|
65
70
|
protocolHandlerBuilder,
|
|
66
71
|
subLogger: subMc.logger,
|
|
@@ -106,6 +111,7 @@ export class Loader {
|
|
|
106
111
|
}
|
|
107
112
|
request.headers ?? (request.headers = {});
|
|
108
113
|
// If set in both query string and headers, use query string. Also write the value from the query string into the header either way.
|
|
114
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
109
115
|
request.headers[LoaderHeader.version] =
|
|
110
116
|
parsed.version ?? request.headers[LoaderHeader.version];
|
|
111
117
|
return this.loadContainer(request, resolvedAsFluid, pendingLocalState);
|
|
@@ -113,11 +119,15 @@ export class Loader {
|
|
|
113
119
|
async loadContainer(request, resolvedUrl, pendingLocalState) {
|
|
114
120
|
return Container.load({
|
|
115
121
|
resolvedUrl,
|
|
122
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
116
123
|
version: request.headers?.[LoaderHeader.version] ?? undefined,
|
|
124
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
117
125
|
loadMode: request.headers?.[LoaderHeader.loadMode],
|
|
118
126
|
pendingLocalState,
|
|
119
127
|
}, {
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
120
129
|
canReconnect: request.headers?.[LoaderHeader.reconnect],
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
121
131
|
clientDetailsOverride: request.headers?.[LoaderHeader.clientDetails],
|
|
122
132
|
...this.services,
|
|
123
133
|
});
|
package/lib/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAQN,YAAY,GACZ,MAAM,gDAAgD,CAAC;AAcxD,OAAO,EAGN,gBAAgB,EAChB,4BAA4B,EAC5B,sBAAsB,EACtB,4BAA4B,GAC5B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,EACN,gDAAgD,EAChD,6BAA6B,GAC7B,MAAM,YAAY,CAAC;AAEpB,SAAS,wBAAwB,CAChC,QAAkC;IAElC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACjD,C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EAAC;QACvB,qIAAqI;QACrI,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC;YACpC,MAAM,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAEzD,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,eAAe,EAAE,iBAAiB,CAAC,CAAC;IACxE,CAAC;IAEO,KAAK,CAAC,aAAa,CAC1B,OAAiB,EACjB,WAAyB,EACzB,iBAA0C;QAE1C,OAAO,SAAS,CAAC,IAAI,CACpB;YACC,WAAW;YACX,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,SAAS;YAC7D,QAAQ,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC;YAClD,iBAAiB;SACjB,EACD;YACC,YAAY,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC;YACvD,qBAAqB,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC;YACpE,GAAG,IAAI,CAAC,QAAQ;SAChB,CACD,CAAC;IACH,CAAC;CACD","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 as ILoaderOptions1,\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\tIDocumentStorageService,\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\tversion: request.headers?.[LoaderHeader.version] ?? undefined,\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\tcanReconnect: request.headers?.[LoaderHeader.reconnect],\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 * @alpha\n */\nexport interface ILoaderOptions extends ILoaderOptions1 {\n\tsummarizeProtocolTree?: boolean;\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 * @alpha\n */\nexport interface IFluidModuleWithDetails {\n\t/** Fluid code module that implements the runtime factory needed to instantiate the container runtime. */\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 * @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 * @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 * Blobs storage for detached containers.\n\t */\n\treadonly detachedBlobStorage?: IDetachedBlobStorage;\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 * @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 * Blobs storage for detached containers.\n\t * @deprecated - IDetachedBlobStorage will be removed in a future release without a replacement. Blobs created while detached will be stored in memory to align with attached container behavior. AB#8049\n\t */\n\treadonly detachedBlobStorage?: IDetachedBlobStorage;\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 * Subset of IDocumentStorageService which only supports createBlob() and readBlob(). This is used to support\n * blobs in detached containers.\n * @alpha\n *\n * @deprecated - IDetachedBlobStorage will be removed in a future release without a replacement. Blobs created while detached will be stored in memory to align with attached container behavior. AB#8049\n */\nexport type IDetachedBlobStorage = Pick<IDocumentStorageService, \"createBlob\" | \"readBlob\"> & {\n\tsize: number;\n\t/**\n\t * Return an array of all blob IDs present in storage\n\t */\n\tgetBlobIds(): string[];\n\n\t/**\n\t * After the container is attached, the detached blob storage is no longer needed and will be disposed.\n\t */\n\tdispose?(): void;\n};\n\n/**\n * Manages Fluid resource loading\n * @alpha\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\tdetachedBlobStorage,\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, ILoader: this } : { ...scope },\n\t\t\tdetachedBlobStorage,\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\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\tversion: request.headers?.[LoaderHeader.version] ?? undefined,\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\tcanReconnect: request.headers?.[LoaderHeader.reconnect],\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,OAAO,EAQN,YAAY,GACZ,MAAM,gDAAgD,CAAC;AAcxD,OAAO,EAGN,gBAAgB,EAChB,4BAA4B,EAC5B,sBAAsB,EACtB,4BAA4B,GAC5B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3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poration 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 as ILoaderOptions1,\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\tIDocumentStorageService,\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 * @legacy\n * @alpha\n */\nexport interface ILoaderOptions extends ILoaderOptions1 {\n\tsummarizeProtocolTree?: boolean;\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 * Blobs storage for detached containers.\n\t */\n\treadonly detachedBlobStorage?: IDetachedBlobStorage;\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 * Blobs storage for detached containers.\n\t * @deprecated - IDetachedBlobStorage will be removed in a future release without a replacement. Blobs created while detached will be stored in memory to align with attached container behavior. AB#8049\n\t */\n\treadonly detachedBlobStorage?: IDetachedBlobStorage;\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 * Subset of IDocumentStorageService which only supports createBlob() and readBlob(). This is used to support\n * blobs in detached containers.\n * @legacy\n * @alpha\n *\n * @deprecated - IDetachedBlobStorage will be removed in a future release without a replacement. Blobs created while detached will be stored in memory to align with attached container behavior. AB#8049\n */\nexport type IDetachedBlobStorage = Pick<IDocumentStorageService, \"createBlob\" | \"readBlob\"> & {\n\tsize: number;\n\t/**\n\t * Return an array of all blob IDs present in storage\n\t */\n\tgetBlobIds(): string[];\n\n\t/**\n\t * After the container is attached, the detached blob storage is no longer needed and will be disposed.\n\t */\n\tdispose?(): void;\n};\n\n/**\n * Manages Fluid resource loading\n * @legacy\n * @alpha\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\tdetachedBlobStorage,\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\tdetachedBlobStorage,\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"]}
|
|
@@ -10,7 +10,7 @@ import { ILocationRedirectionError, IUrlResolver } from "@fluidframework/driver-
|
|
|
10
10
|
* @returns `true` is the error is location redirection error, otherwise `false`.
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
|
-
export declare function isLocationRedirectionError(error:
|
|
13
|
+
export declare function isLocationRedirectionError(error: unknown): error is ILocationRedirectionError;
|
|
14
14
|
/**
|
|
15
15
|
* Handles location redirection while fulfilling the loader request.
|
|
16
16
|
* @param api - Callback in which user can wrap the loader.resolve or loader.request call.
|
|
@@ -18,6 +18,7 @@ export declare function isLocationRedirectionError(error: any): error is ILocati
|
|
|
18
18
|
* @param urlResolver - resolver used to resolve the url.
|
|
19
19
|
* @param logger - logger to send events.
|
|
20
20
|
* @returns Response from the API call.
|
|
21
|
+
* @legacy
|
|
21
22
|
* @alpha
|
|
22
23
|
*/
|
|
23
24
|
export declare function resolveWithLocationRedirectionHandling<T>(api: (request: IRequest) => Promise<T>, request: IRequest, urlResolver: IUrlResolver, logger?: ITelemetryBaseLogger): Promise<T>;
|
|
@@ -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;AACjF,OAAO,EACN,yBAAyB,EACzB,YAAY,EAEZ,MAAM,6CAA6C,CAAC;AAGrD;;;;;GAKG;AACH,wBAAgB,0BAA0B,
|
|
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;AACjF,OAAO,EACN,yBAAyB,EACzB,YAAY,EAEZ,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"}
|
|
@@ -13,7 +13,8 @@ import { createChildLogger } from "@fluidframework/telemetry-utils/internal";
|
|
|
13
13
|
export function isLocationRedirectionError(error) {
|
|
14
14
|
return (typeof error === "object" &&
|
|
15
15
|
error !== null &&
|
|
16
|
-
error.errorType ===
|
|
16
|
+
error.errorType ===
|
|
17
|
+
DriverErrorTypes.locationRedirection);
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* Handles location redirection while fulfilling the loader request.
|
|
@@ -22,6 +23,7 @@ export function isLocationRedirectionError(error) {
|
|
|
22
23
|
* @param urlResolver - resolver used to resolve the url.
|
|
23
24
|
* @param logger - logger to send events.
|
|
24
25
|
* @returns Response from the API call.
|
|
26
|
+
* @legacy
|
|
25
27
|
* @alpha
|
|
26
28
|
*/
|
|
27
29
|
export async function resolveWithLocationRedirectionHandling(api, request, urlResolver, logger) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveWithLocationRedirection.js","sourceRoot":"","sources":["../../src/location-redirection-utilities/resolveWithLocationRedirection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAGN,gBAAgB,GAChB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,
|
|
1
|
+
{"version":3,"file":"resolveWithLocationRedirection.js","sourceRoot":"","sources":["../../src/location-redirection-utilities/resolveWithLocationRedirection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAGN,gBAAgB,GAChB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CACzC,KAAc;IAEd,OAAO,CACN,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACb,KAA4C,CAAC,SAAS;YACtD,gBAAgB,CAAC,mBAAmB,CACrC,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAC3D,GAAsC,EACtC,OAAiB,EACjB,WAAyB,EACzB,MAA6B;IAE7B,IAAI,GAAG,GAAa,OAAO,CAAC;IAC5B,MAAM,WAAW,GAAG,iBAAiB,CAAC,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","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\tILocationRedirectionError,\n\tIUrlResolver,\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 * @alpha\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memoryBlobStorage.d.ts","sourceRoot":"","sources":["../src/memoryBlobStorage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAuBxD,wBAAgB,kCAAkC,CAEjD,eAAe,EAAE,oBAAoB,GAAG,SAAS,GAC/C,MAAM,GAAG,SAAS,CAQpB;AAED,wBAAgB,sCAAsC,CAErD,eAAe,EAAE,oBAAoB,GAAG,SAAS,EACjD,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"memoryBlobStorage.d.ts","sourceRoot":"","sources":["../src/memoryBlobStorage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAuBxD,wBAAgB,kCAAkC,CAEjD,eAAe,EAAE,oBAAoB,GAAG,SAAS,GAC/C,MAAM,GAAG,SAAS,CAQpB;AAED,wBAAgB,sCAAsC,CAErD,eAAe,EAAE,oBAAoB,GAAG,SAAS,EACjD,eAAe,EAAE,MAAM,GACrB,IAAI,CAcN;AAGD,wBAAgB,+BAA+B,IAAI,oBAAoB,CAmBtE"}
|
package/lib/memoryBlobStorage.js
CHANGED
|
@@ -29,8 +29,10 @@ detachedStorage, attachmentBlobs) {
|
|
|
29
29
|
throw new Error("DetachedBlobStorage was not provided to the loader during serialize so cannot be provided during rehydrate.");
|
|
30
30
|
}
|
|
31
31
|
assert(detachedStorage.size === 0, 0x99e /* Blob storage already initialized */);
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
32
33
|
const maybeAttachmentBlobs = JSON.parse(attachmentBlobs);
|
|
33
34
|
assert(Array.isArray(maybeAttachmentBlobs), 0x99f /* Invalid attachmentBlobs */);
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
34
36
|
detachedStorage.initialize(maybeAttachmentBlobs);
|
|
35
37
|
}
|
|
36
38
|
// eslint-disable-next-line import/no-deprecated
|
|
@@ -47,8 +49,8 @@ export function createMemoryDetachedBlobStorage() {
|
|
|
47
49
|
},
|
|
48
50
|
getBlobIds: () => blobs.map((_, i) => `${i}`),
|
|
49
51
|
dispose: () => blobs.splice(0),
|
|
50
|
-
serialize: () => JSON.stringify(blobs.map((b) => bufferToString(b, "
|
|
51
|
-
initialize: (attachmentBlobs) => blobs.push(...attachmentBlobs.map((maybeBlob) => stringToBuffer(maybeBlob, "
|
|
52
|
+
serialize: () => JSON.stringify(blobs.map((b) => bufferToString(b, "utf8"))),
|
|
53
|
+
initialize: (attachmentBlobs) => blobs.push(...attachmentBlobs.map((maybeBlob) => stringToBuffer(maybeBlob, "utf8"))),
|
|
52
54
|
};
|
|
53
55
|
return storage;
|
|
54
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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,CAAC,IAAI,KAAK,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;QACxE,IAAI,IAAI;YACP,OAAO,KAAK,CAAC,MAAM,CAAC;QACrB,CAAC;QACD,UAAU,EAAE,GAAa,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;QACvD,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9B,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QAC5E,UAAU,EAAE,CAAC,eAAyB,EAAE,EAAE,CACzC,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;KACrF,CAAC;IACF,OAAO,OAAO,CAAC;AAChB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString, stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { assert, isObject } from \"@fluidframework/core-utils/internal\";\nimport type { ICreateBlobResponse } from \"@fluidframework/driver-definitions/internal\";\n\n// eslint-disable-next-line import/no-deprecated\nimport type { IDetachedBlobStorage } from \"./loader.js\";\n\nconst MemoryDetachedBlobStorageIdentifier = Symbol();\n\n// eslint-disable-next-line import/no-deprecated\ninterface MemoryDetachedBlobStorage extends IDetachedBlobStorage {\n\t[MemoryDetachedBlobStorageIdentifier]: typeof MemoryDetachedBlobStorageIdentifier;\n\tinitialize(attachmentBlobs: string[]): void;\n\tserialize(): string | undefined;\n}\n\nfunction isMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage | undefined,\n): detachedStorage is MemoryDetachedBlobStorage {\n\treturn (\n\t\tisObject(detachedStorage) &&\n\t\tMemoryDetachedBlobStorageIdentifier in detachedStorage &&\n\t\tdetachedStorage[MemoryDetachedBlobStorageIdentifier] ===\n\t\t\tMemoryDetachedBlobStorageIdentifier\n\t);\n}\n\nexport function serializeMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage | undefined,\n): string | undefined {\n\tif (\n\t\tdetachedStorage !== undefined &&\n\t\tdetachedStorage.size > 0 &&\n\t\tisMemoryDetachedBlobStorage(detachedStorage)\n\t) {\n\t\treturn detachedStorage.serialize();\n\t}\n}\n\nexport function tryInitializeMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage | undefined,\n\tattachmentBlobs: string,\n): void {\n\tif (!isMemoryDetachedBlobStorage(detachedStorage)) {\n\t\tthrow new Error(\n\t\t\t\"DetachedBlobStorage was not provided to the loader during serialize so cannot be provided during rehydrate.\",\n\t\t);\n\t}\n\n\tassert(detachedStorage.size === 0, 0x99e /* Blob storage already initialized */);\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\tconst maybeAttachmentBlobs = JSON.parse(attachmentBlobs);\n\tassert(Array.isArray(maybeAttachmentBlobs), 0x99f /* Invalid attachmentBlobs */);\n\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\tdetachedStorage.initialize(maybeAttachmentBlobs);\n}\n\n// eslint-disable-next-line import/no-deprecated\nexport function createMemoryDetachedBlobStorage(): IDetachedBlobStorage {\n\tconst blobs: ArrayBufferLike[] = [];\n\tconst storage: MemoryDetachedBlobStorage = {\n\t\t[MemoryDetachedBlobStorageIdentifier]: MemoryDetachedBlobStorageIdentifier,\n\t\tcreateBlob: async (file: ArrayBufferLike): Promise<ICreateBlobResponse> => ({\n\t\t\tid: `${blobs.push(file) - 1}`,\n\t\t}),\n\t\treadBlob: async (id: string): Promise<ArrayBufferLike> =>\n\t\t\tblobs[Number(id)] ?? Promise.reject(new Error(`Blob not found: ${id}`)),\n\t\tget size() {\n\t\t\treturn blobs.length;\n\t\t},\n\t\tgetBlobIds: (): string[] => blobs.map((_, i) => `${i}`),\n\t\tdispose: () => blobs.splice(0),\n\t\tserialize: () => JSON.stringify(blobs.map((b) => bufferToString(b, \"utf8\"))),\n\t\tinitialize: (attachmentBlobs: string[]) =>\n\t\t\tblobs.push(...attachmentBlobs.map((maybeBlob) => stringToBuffer(maybeBlob, \"utf8\"))),\n\t};\n\treturn storage;\n}\n"]}
|
package/lib/noopHeuristic.js
CHANGED
|
@@ -31,7 +31,7 @@ export class NoopHeuristic extends TypedEventEmitter {
|
|
|
31
31
|
super();
|
|
32
32
|
this.NoopCountFrequency = NoopCountFrequency;
|
|
33
33
|
this.opsProcessedSinceOpSent = 0;
|
|
34
|
-
if (NoopTimeFrequency !==
|
|
34
|
+
if (NoopTimeFrequency !== Number.POSITIVE_INFINITY) {
|
|
35
35
|
this.timer = new Timer(NoopTimeFrequency, () => {
|
|
36
36
|
// We allow the timer to expire even if an op is sent or we disconnect.
|
|
37
37
|
// This condition is to guard against trying to send a noop anyway in that case.
|
package/lib/noopHeuristic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noopHeuristic.js","sourceRoot":"","sources":["../src/noopHeuristic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE,MAAM,wBAAwB,GAAG,IAAI,CAAC;AACtC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAMrC,6FAA6F;AAC7F,4GAA4G;AAC5G,yG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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","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"]}
|
package/lib/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.0
|
|
8
|
+
export declare const pkgVersion = "2.1.0-276326";
|
|
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,iBAAiB,CAAC"}
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,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.1.0-276326\";\n"]}
|