@fluidframework/odsp-driver 2.0.0-internal.2.2.0 → 2.0.0-internal.2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +1 -1
- package/dist/WriteBufferUtils.d.ts.map +1 -1
- package/dist/WriteBufferUtils.js +0 -1
- package/dist/WriteBufferUtils.js.map +1 -1
- package/dist/contractsPublic.d.ts.map +1 -1
- package/dist/contractsPublic.js.map +1 -1
- package/dist/createFile.d.ts +2 -6
- package/dist/createFile.d.ts.map +1 -1
- package/dist/createFile.js +13 -125
- package/dist/createFile.js.map +1 -1
- package/dist/createNewUtils.d.ts +16 -0
- package/dist/createNewUtils.d.ts.map +1 -1
- package/dist/createNewUtils.js +131 -1
- package/dist/createNewUtils.js.map +1 -1
- package/dist/fetchSnapshot.js +1 -1
- package/dist/fetchSnapshot.js.map +1 -1
- package/dist/localOdspDriver/localOdspDocumentServiceFactory.d.ts.map +1 -1
- package/dist/localOdspDriver/localOdspDocumentServiceFactory.js +1 -1
- package/dist/localOdspDriver/localOdspDocumentServiceFactory.js.map +1 -1
- package/dist/odspDelayLoadedDeltaStream.d.ts +75 -0
- package/dist/odspDelayLoadedDeltaStream.d.ts.map +1 -0
- package/dist/odspDelayLoadedDeltaStream.js +259 -0
- package/dist/odspDelayLoadedDeltaStream.js.map +1 -0
- package/dist/odspDocumentDeltaConnection.d.ts +1 -3
- package/dist/odspDocumentDeltaConnection.d.ts.map +1 -1
- package/dist/odspDocumentDeltaConnection.js +8 -7
- package/dist/odspDocumentDeltaConnection.js.map +1 -1
- package/dist/odspDocumentService.d.ts +10 -25
- package/dist/odspDocumentService.d.ts.map +1 -1
- package/dist/odspDocumentService.js +71 -204
- package/dist/odspDocumentService.js.map +1 -1
- package/dist/odspDocumentServiceFactory.d.ts.map +1 -1
- package/dist/odspDocumentServiceFactory.js +1 -2
- package/dist/odspDocumentServiceFactory.js.map +1 -1
- package/dist/odspDocumentServiceFactoryCore.d.ts +1 -3
- package/dist/odspDocumentServiceFactoryCore.d.ts.map +1 -1
- package/dist/odspDocumentServiceFactoryCore.js +3 -3
- package/dist/odspDocumentServiceFactoryCore.js.map +1 -1
- package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts +4 -0
- package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +1 -1
- package/dist/odspDocumentServiceFactoryWithCodeSplit.js +5 -20
- package/dist/odspDocumentServiceFactoryWithCodeSplit.js.map +1 -1
- package/dist/odspDocumentStorageManager.d.ts.map +1 -1
- package/dist/odspDocumentStorageManager.js +0 -2
- package/dist/odspDocumentStorageManager.js.map +1 -1
- package/dist/odspDocumentStorageServiceBase.d.ts.map +1 -1
- package/dist/odspDocumentStorageServiceBase.js +0 -2
- package/dist/odspDocumentStorageServiceBase.js.map +1 -1
- package/dist/odspSummaryUploadManager.d.ts.map +1 -1
- package/dist/odspSummaryUploadManager.js +0 -2
- package/dist/odspSummaryUploadManager.js.map +1 -1
- package/dist/odspUtils.d.ts +10 -1
- package/dist/odspUtils.d.ts.map +1 -1
- package/dist/odspUtils.js +5 -1
- package/dist/odspUtils.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/zipItDataRepresentationUtils.d.ts.map +1 -1
- package/dist/zipItDataRepresentationUtils.js +0 -1
- package/dist/zipItDataRepresentationUtils.js.map +1 -1
- package/lib/WriteBufferUtils.d.ts.map +1 -1
- package/lib/WriteBufferUtils.js +0 -1
- package/lib/WriteBufferUtils.js.map +1 -1
- package/lib/contractsPublic.d.ts.map +1 -1
- package/lib/contractsPublic.js.map +1 -1
- package/lib/createFile.d.ts +2 -6
- package/lib/createFile.d.ts.map +1 -1
- package/lib/createFile.js +15 -126
- package/lib/createFile.js.map +1 -1
- package/lib/createNewUtils.d.ts +16 -0
- package/lib/createNewUtils.d.ts.map +1 -1
- package/lib/createNewUtils.js +129 -1
- package/lib/createNewUtils.js.map +1 -1
- package/lib/fetchSnapshot.js +1 -1
- package/lib/fetchSnapshot.js.map +1 -1
- package/lib/localOdspDriver/localOdspDocumentServiceFactory.d.ts.map +1 -1
- package/lib/localOdspDriver/localOdspDocumentServiceFactory.js +1 -1
- package/lib/localOdspDriver/localOdspDocumentServiceFactory.js.map +1 -1
- package/lib/odspDelayLoadedDeltaStream.d.ts +75 -0
- package/lib/odspDelayLoadedDeltaStream.d.ts.map +1 -0
- package/lib/odspDelayLoadedDeltaStream.js +255 -0
- package/lib/odspDelayLoadedDeltaStream.js.map +1 -0
- package/lib/odspDocumentDeltaConnection.d.ts +1 -3
- package/lib/odspDocumentDeltaConnection.d.ts.map +1 -1
- package/lib/odspDocumentDeltaConnection.js +8 -7
- package/lib/odspDocumentDeltaConnection.js.map +1 -1
- package/lib/odspDocumentService.d.ts +10 -25
- package/lib/odspDocumentService.d.ts.map +1 -1
- package/lib/odspDocumentService.js +56 -207
- package/lib/odspDocumentService.js.map +1 -1
- package/lib/odspDocumentServiceFactory.d.ts.map +1 -1
- package/lib/odspDocumentServiceFactory.js +1 -2
- package/lib/odspDocumentServiceFactory.js.map +1 -1
- package/lib/odspDocumentServiceFactoryCore.d.ts +1 -3
- package/lib/odspDocumentServiceFactoryCore.d.ts.map +1 -1
- package/lib/odspDocumentServiceFactoryCore.js +3 -3
- package/lib/odspDocumentServiceFactoryCore.js.map +1 -1
- package/lib/odspDocumentServiceFactoryWithCodeSplit.d.ts +4 -0
- package/lib/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +1 -1
- package/lib/odspDocumentServiceFactoryWithCodeSplit.js +5 -1
- package/lib/odspDocumentServiceFactoryWithCodeSplit.js.map +1 -1
- package/lib/odspDocumentStorageManager.d.ts.map +1 -1
- package/lib/odspDocumentStorageManager.js +0 -2
- package/lib/odspDocumentStorageManager.js.map +1 -1
- package/lib/odspDocumentStorageServiceBase.d.ts.map +1 -1
- package/lib/odspDocumentStorageServiceBase.js +0 -2
- package/lib/odspDocumentStorageServiceBase.js.map +1 -1
- package/lib/odspSummaryUploadManager.d.ts.map +1 -1
- package/lib/odspSummaryUploadManager.js +0 -2
- package/lib/odspSummaryUploadManager.js.map +1 -1
- package/lib/odspUtils.d.ts +10 -1
- package/lib/odspUtils.d.ts.map +1 -1
- package/lib/odspUtils.js +3 -0
- package/lib/odspUtils.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/zipItDataRepresentationUtils.d.ts.map +1 -1
- package/lib/zipItDataRepresentationUtils.js +0 -1
- package/lib/zipItDataRepresentationUtils.js.map +1 -1
- package/package.json +14 -14
- package/src/WriteBufferUtils.ts +0 -1
- package/src/contractsPublic.ts +0 -1
- package/src/createFile.ts +23 -168
- package/src/createNewUtils.ts +188 -2
- package/src/fetchSnapshot.ts +1 -1
- package/src/localOdspDriver/localOdspDocumentServiceFactory.ts +0 -1
- package/src/odspDelayLoadedDeltaStream.ts +359 -0
- package/src/odspDocumentDeltaConnection.ts +11 -8
- package/src/odspDocumentService.ts +63 -283
- package/src/odspDocumentServiceFactory.ts +0 -2
- package/src/odspDocumentServiceFactoryCore.ts +1 -3
- package/src/odspDocumentServiceFactoryWithCodeSplit.ts +4 -1
- package/src/odspDocumentStorageManager.ts +0 -4
- package/src/odspDocumentStorageServiceBase.ts +0 -3
- package/src/odspSummaryUploadManager.ts +0 -4
- package/src/odspUtils.ts +16 -1
- package/src/packageVersion.ts +1 -1
- package/src/zipItDataRepresentationUtils.ts +0 -1
- package/dist/getSocketIo.d.ts +0 -11
- package/dist/getSocketIo.d.ts.map +0 -1
- package/dist/getSocketIo.js +0 -20
- package/dist/getSocketIo.js.map +0 -1
- package/lib/getSocketIo.d.ts +0 -11
- package/lib/getSocketIo.d.ts.map +0 -1
- package/lib/getSocketIo.js +0 -13
- package/lib/getSocketIo.js.map +0 -1
- package/src/getSocketIo.ts +0 -14
|
@@ -6,7 +6,6 @@ import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
|
6
6
|
import { IDocumentDeltaConnection, IDocumentDeltaStorageService, IDocumentService, IResolvedUrl, IDocumentStorageService, IDocumentServicePolicies } from "@fluidframework/driver-definitions";
|
|
7
7
|
import { IClient, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
8
8
|
import { IOdspResolvedUrl, TokenFetchOptions, HostStoragePolicy, InstrumentedStorageTokenFetcher } from "@fluidframework/odsp-driver-definitions";
|
|
9
|
-
import type { io as SocketIOClientStatic } from "socket.io-client";
|
|
10
9
|
import { IOdspCache } from "./odspCache";
|
|
11
10
|
import { EpochTracker } from "./epochTracker";
|
|
12
11
|
import { OpsCache } from "./opsCaching";
|
|
@@ -18,13 +17,14 @@ export declare class OdspDocumentService implements IDocumentService {
|
|
|
18
17
|
readonly odspResolvedUrl: IOdspResolvedUrl;
|
|
19
18
|
private readonly getStorageToken;
|
|
20
19
|
private readonly getWebsocketToken;
|
|
21
|
-
private readonly socketIoClientFactory;
|
|
22
20
|
private readonly cache;
|
|
23
21
|
private readonly epochTracker;
|
|
24
22
|
private readonly socketReferenceKeyPrefix?;
|
|
25
23
|
private readonly clientIsSummarizer?;
|
|
26
|
-
private _policies;
|
|
27
|
-
private
|
|
24
|
+
private readonly _policies;
|
|
25
|
+
private socketModuleP;
|
|
26
|
+
private odspDelayLoadedDeltaStream;
|
|
27
|
+
private odspSocketModuleLoaded;
|
|
28
28
|
/**
|
|
29
29
|
* @param resolvedUrl - resolved url identifying document that will be managed by returned service instance.
|
|
30
30
|
* @param getStorageToken - function that can provide the storage token. This is is also referred to as
|
|
@@ -33,20 +33,16 @@ export declare class OdspDocumentService implements IDocumentService {
|
|
|
33
33
|
* to as the "Push" token in SPO. If undefined then websocket token is expected to be returned with joinSession
|
|
34
34
|
* response payload.
|
|
35
35
|
* @param logger - a logger that can capture performance and diagnostic information
|
|
36
|
-
* @param socketIoClientFactory - A factory that returns a promise to the socket io library required by the driver
|
|
37
36
|
* @param cache - This caches response for joinSession.
|
|
38
37
|
* @param hostPolicy - This host constructed policy which customizes service behavior.
|
|
39
38
|
* @param epochTracker - This helper class which adds epoch to backend calls made by returned service instance.
|
|
40
39
|
* @param socketReferenceKeyPrefix - (optional) prefix to isolate socket reuse cache
|
|
41
40
|
*/
|
|
42
|
-
static create(resolvedUrl: IResolvedUrl, getStorageToken: InstrumentedStorageTokenFetcher, getWebsocketToken: ((options: TokenFetchOptions) => Promise<string | null>) | undefined, logger: ITelemetryLogger,
|
|
41
|
+
static create(resolvedUrl: IResolvedUrl, getStorageToken: InstrumentedStorageTokenFetcher, getWebsocketToken: ((options: TokenFetchOptions) => Promise<string | null>) | undefined, logger: ITelemetryLogger, cache: IOdspCache, hostPolicy: HostStoragePolicy, epochTracker: EpochTracker, socketReferenceKeyPrefix?: string, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
43
42
|
private storageManager?;
|
|
44
43
|
private readonly mc;
|
|
45
|
-
private readonly joinSessionKey;
|
|
46
44
|
private readonly hostPolicy;
|
|
47
45
|
private _opsCache?;
|
|
48
|
-
private currentConnection?;
|
|
49
|
-
private relayServiceTenantAndSessionId;
|
|
50
46
|
/**
|
|
51
47
|
* @param odspResolvedUrl - resolved url identifying document that will be managed by this service instance.
|
|
52
48
|
* @param getStorageToken - function that can provide the storage token. This is is also referred to as
|
|
@@ -76,30 +72,19 @@ export declare class OdspDocumentService implements IDocumentService {
|
|
|
76
72
|
* @returns returns the document delta storage service for sharepoint driver.
|
|
77
73
|
*/
|
|
78
74
|
connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
|
|
79
|
-
/** Annotate the given error indicating which connection step failed */
|
|
80
|
-
private annotateConnectionError;
|
|
81
75
|
/**
|
|
82
76
|
* Connects to a delta stream endpoint for emitting ops.
|
|
83
77
|
*
|
|
84
78
|
* @returns returns the document delta stream service for onedrive/sharepoint driver.
|
|
85
79
|
*/
|
|
86
80
|
connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;
|
|
87
|
-
private clearJoinSessionTimer;
|
|
88
|
-
private scheduleJoinSessionRefresh;
|
|
89
|
-
private joinSession;
|
|
90
|
-
private joinSessionCore;
|
|
91
|
-
private calculateJoinSessionRefreshDelta;
|
|
92
81
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* @
|
|
97
|
-
* @param token - authorization token for delta service
|
|
98
|
-
* @param io - websocket library
|
|
99
|
-
* @param client - information about the client
|
|
100
|
-
* @param webSocketUrl - websocket URL
|
|
82
|
+
* This dynamically imports the module for loading the delta connection. In many cases the delta stream, is not
|
|
83
|
+
* required during the critical load flow. So this way we don't have to bundle this in the initial bundle and can
|
|
84
|
+
* import this later on when required.
|
|
85
|
+
* @returns - delta stream object.
|
|
101
86
|
*/
|
|
102
|
-
private
|
|
87
|
+
private getDelayLoadedDeltaStream;
|
|
103
88
|
dispose(error?: any): void;
|
|
104
89
|
protected get opsCache(): OpsCache | undefined;
|
|
105
90
|
protected opsReceived(ops: ISequencedDocumentMessage[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspDocumentService.d.ts","sourceRoot":"","sources":["../src/odspDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"odspDocumentService.d.ts","sourceRoot":"","sources":["../src/odspDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAOtE,OAAO,EACH,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,wBAAwB,EAC3B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACH,OAAO,EACP,yBAAyB,EAC5B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EAEjB,iBAAiB,E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CAAW;IAE7B;;;;;;;;;;;;;OAaG;IACH,OAAO;IA+BP,IAAW,WAAW,IAAI,YAAY,CAErC;IACD,IAAW,QAAQ,6BAElB;IAED;;;;OAIG;IACU,gBAAgB,IAAI,OAAO,CAAC,uBAAuB,CAAC;IA4BjE;;;;OAIG;IACU,qBAAqB,IAAI,OAAO,CAAC,4BAA4B,CAAC;IAmC3E;;;;OAIG;IACU,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAiBrF;;;;;OAKG;YACW,yBAAyB;IA0BhC,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG;IAe1B,SAAS,KAAK,QAAQ,yBA8BrB;IAID,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,yBAAyB,EAAE;CAQzD"}
|
|
@@ -3,23 +3,35 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
6
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
26
|
exports.OdspDocumentService = void 0;
|
|
8
27
|
const common_utils_1 = require("@fluidframework/common-utils");
|
|
9
28
|
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
10
|
-
const driver_definitions_1 = require("@fluidframework/driver-definitions");
|
|
11
|
-
const driver_utils_1 = require("@fluidframework/driver-utils");
|
|
12
|
-
const odsp_driver_definitions_1 = require("@fluidframework/odsp-driver-definitions");
|
|
13
|
-
const odsp_doclib_utils_1 = require("@fluidframework/odsp-doclib-utils");
|
|
14
29
|
const odspDeltaStorageService_1 = require("./odspDeltaStorageService");
|
|
15
|
-
const odspDocumentDeltaConnection_1 = require("./odspDocumentDeltaConnection");
|
|
16
30
|
const odspDocumentStorageManager_1 = require("./odspDocumentStorageManager");
|
|
17
31
|
const odspUtils_1 = require("./odspUtils");
|
|
18
|
-
const vroom_1 = require("./vroom");
|
|
19
32
|
const odspUrlHelper_1 = require("./odspUrlHelper");
|
|
20
33
|
const opsCaching_1 = require("./opsCaching");
|
|
21
34
|
const retryErrorsStorageAdapter_1 = require("./retryErrorsStorageAdapter");
|
|
22
|
-
const packageVersion_1 = require("./packageVersion");
|
|
23
35
|
/**
|
|
24
36
|
* The DocumentService manages the Socket.IO connection and manages routing requests to connected
|
|
25
37
|
* clients
|
|
@@ -39,20 +51,19 @@ class OdspDocumentService {
|
|
|
39
51
|
* @param epochTracker - This helper class which adds epoch to backend calls made by this service instance.
|
|
40
52
|
* @param socketReferenceKeyPrefix - (optional) prefix to isolate socket reuse cache
|
|
41
53
|
*/
|
|
42
|
-
constructor(odspResolvedUrl, getStorageToken, getWebsocketToken, logger,
|
|
54
|
+
constructor(odspResolvedUrl, getStorageToken, getWebsocketToken, logger, cache, hostPolicy, epochTracker, socketReferenceKeyPrefix, clientIsSummarizer) {
|
|
43
55
|
this.odspResolvedUrl = odspResolvedUrl;
|
|
44
56
|
this.getStorageToken = getStorageToken;
|
|
45
57
|
this.getWebsocketToken = getWebsocketToken;
|
|
46
|
-
this.socketIoClientFactory = socketIoClientFactory;
|
|
47
58
|
this.cache = cache;
|
|
48
59
|
this.epochTracker = epochTracker;
|
|
49
60
|
this.socketReferenceKeyPrefix = socketReferenceKeyPrefix;
|
|
50
61
|
this.clientIsSummarizer = clientIsSummarizer;
|
|
62
|
+
this.odspSocketModuleLoaded = false;
|
|
51
63
|
this._policies = {
|
|
52
64
|
// load in storage-only mode if a file version is specified
|
|
53
65
|
storageOnly: odspResolvedUrl.fileVersion !== undefined,
|
|
54
66
|
};
|
|
55
|
-
this.joinSessionKey = `${this.odspResolvedUrl.hashedDocumentId}/joinsession`;
|
|
56
67
|
this.mc = (0, telemetry_utils_1.loggerToMonitoringContext)(telemetry_utils_1.ChildLogger.create(logger, undefined, {
|
|
57
68
|
all: {
|
|
58
69
|
odc: (0, odspUrlHelper_1.isOdcOrigin)(new URL(this.odspResolvedUrl.endpoints.snapshotStorageUrl).origin),
|
|
@@ -71,14 +82,13 @@ class OdspDocumentService {
|
|
|
71
82
|
* to as the "Push" token in SPO. If undefined then websocket token is expected to be returned with joinSession
|
|
72
83
|
* response payload.
|
|
73
84
|
* @param logger - a logger that can capture performance and diagnostic information
|
|
74
|
-
* @param socketIoClientFactory - A factory that returns a promise to the socket io library required by the driver
|
|
75
85
|
* @param cache - This caches response for joinSession.
|
|
76
86
|
* @param hostPolicy - This host constructed policy which customizes service behavior.
|
|
77
87
|
* @param epochTracker - This helper class which adds epoch to backend calls made by returned service instance.
|
|
78
88
|
* @param socketReferenceKeyPrefix - (optional) prefix to isolate socket reuse cache
|
|
79
89
|
*/
|
|
80
|
-
static async create(resolvedUrl, getStorageToken, getWebsocketToken, logger,
|
|
81
|
-
return new OdspDocumentService((0, odspUtils_1.getOdspResolvedUrl)(resolvedUrl), getStorageToken, getWebsocketToken, logger,
|
|
90
|
+
static async create(resolvedUrl, getStorageToken, getWebsocketToken, logger, cache, hostPolicy, epochTracker, socketReferenceKeyPrefix, clientIsSummarizer) {
|
|
91
|
+
return new OdspDocumentService((0, odspUtils_1.getOdspResolvedUrl)(resolvedUrl), getStorageToken, getWebsocketToken, logger, cache, hostPolicy, epochTracker, socketReferenceKeyPrefix, clientIsSummarizer);
|
|
82
92
|
}
|
|
83
93
|
get resolvedUrl() {
|
|
84
94
|
return this.odspResolvedUrl;
|
|
@@ -96,12 +106,15 @@ class OdspDocumentService {
|
|
|
96
106
|
this.storageManager = new odspDocumentStorageManager_1.OdspDocumentStorageService(this.odspResolvedUrl, this.getStorageToken, this.mc.logger, true, this.cache, this.hostPolicy, this.epochTracker,
|
|
97
107
|
// flushCallback
|
|
98
108
|
async () => {
|
|
99
|
-
|
|
100
|
-
|
|
109
|
+
var _a;
|
|
110
|
+
const currentConnection = (_a = this.odspDelayLoadedDeltaStream) === null || _a === void 0 ? void 0 : _a.currentDeltaConnection;
|
|
111
|
+
if (currentConnection !== undefined && !currentConnection.disposed) {
|
|
112
|
+
return currentConnection.flush();
|
|
101
113
|
}
|
|
102
114
|
throw new Error("Disconnected while uploading summary (attempt to perform flush())");
|
|
103
115
|
}, () => {
|
|
104
|
-
|
|
116
|
+
var _a;
|
|
117
|
+
return (_a = this.odspDelayLoadedDeltaStream) === null || _a === void 0 ? void 0 : _a.relayServiceTenantAndSessionId;
|
|
105
118
|
}, this.mc.config.getNumber("Fluid.Driver.Odsp.snapshotFormatFetchType"));
|
|
106
119
|
}
|
|
107
120
|
return new retryErrorsStorageAdapter_1.RetryErrorsStorageAdapter(this.storageManager, this.mc.logger);
|
|
@@ -118,208 +131,63 @@ class OdspDocumentService {
|
|
|
118
131
|
// batch size, please see issue #5211 for data around batch sizing
|
|
119
132
|
const batchSize = (_c = this.hostPolicy.opsBatchSize) !== null && _c !== void 0 ? _c : 5000;
|
|
120
133
|
const concurrency = (_d = this.hostPolicy.concurrentOpsBatches) !== null && _d !== void 0 ? _d : 1;
|
|
121
|
-
return new odspDeltaStorageService_1.OdspDeltaStorageWithCache(snapshotOps, this.mc.logger, batchSize, concurrency,
|
|
134
|
+
return new odspDeltaStorageService_1.OdspDeltaStorageWithCache(snapshotOps, this.mc.logger, batchSize, concurrency,
|
|
135
|
+
// Get Ops from storage callback.
|
|
136
|
+
async (from, to, telemetryProps, fetchReason) => service.get(from, to, telemetryProps, fetchReason),
|
|
137
|
+
// Get cachedOps Callback.
|
|
138
|
+
async (from, to) => {
|
|
122
139
|
var _a, _b;
|
|
123
140
|
const res = await ((_a = this.opsCache) === null || _a === void 0 ? void 0 : _a.get(from, to));
|
|
124
141
|
return (_b = res) !== null && _b !== void 0 ? _b : [];
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
|
|
142
|
+
},
|
|
143
|
+
// Ops requestFromSocket Callback.
|
|
144
|
+
(from, to) => {
|
|
145
|
+
var _a;
|
|
146
|
+
const currentConnection = (_a = this.odspDelayLoadedDeltaStream) === null || _a === void 0 ? void 0 : _a.currentDeltaConnection;
|
|
147
|
+
if (currentConnection !== undefined && !currentConnection.disposed) {
|
|
148
|
+
currentConnection.requestOps(from, to);
|
|
128
149
|
}
|
|
129
150
|
}, (ops) => this.opsReceived(ops));
|
|
130
151
|
}
|
|
131
|
-
/** Annotate the given error indicating which connection step failed */
|
|
132
|
-
annotateConnectionError(error, failedConnectionStep, separateTokenRequest) {
|
|
133
|
-
return (0, telemetry_utils_1.normalizeError)(error, { props: {
|
|
134
|
-
failedConnectionStep,
|
|
135
|
-
separateTokenRequest,
|
|
136
|
-
} });
|
|
137
|
-
}
|
|
138
152
|
/**
|
|
139
153
|
* Connects to a delta stream endpoint for emitting ops.
|
|
140
154
|
*
|
|
141
155
|
* @returns returns the document delta stream service for onedrive/sharepoint driver.
|
|
142
156
|
*/
|
|
143
157
|
async connectToDeltaStream(client) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return (0, odspUtils_1.getWithRetryForTokenRefresh)(async (options) => {
|
|
147
|
-
var _a;
|
|
148
|
-
// Presence of getWebsocketToken callback dictates whether callback is used for fetching
|
|
149
|
-
// websocket token or whether it is returned with joinSession response payload
|
|
150
|
-
const requestWebsocketTokenFromJoinSession = this.getWebsocketToken === undefined;
|
|
151
|
-
const websocketTokenPromise = requestWebsocketTokenFromJoinSession
|
|
152
|
-
? Promise.resolve(null)
|
|
153
|
-
: this.getWebsocketToken(options);
|
|
154
|
-
const annotateAndRethrowConnectionError = (step) => (error) => {
|
|
155
|
-
throw this.annotateConnectionError(error, step, !requestWebsocketTokenFromJoinSession);
|
|
156
|
-
};
|
|
157
|
-
const joinSessionPromise = this.joinSession(requestWebsocketTokenFromJoinSession, options);
|
|
158
|
-
const [websocketEndpoint, websocketToken, io] = await Promise.all([
|
|
159
|
-
joinSessionPromise.catch(annotateAndRethrowConnectionError("joinSession")),
|
|
160
|
-
websocketTokenPromise.catch(annotateAndRethrowConnectionError("getWebsocketToken")),
|
|
161
|
-
this.socketIoClientFactory().catch(annotateAndRethrowConnectionError("socketIoClientFactory")),
|
|
162
|
-
]);
|
|
163
|
-
const finalWebsocketToken = websocketToken !== null && websocketToken !== void 0 ? websocketToken : ((_a = websocketEndpoint.socketToken) !== null && _a !== void 0 ? _a : null);
|
|
164
|
-
if (finalWebsocketToken === null) {
|
|
165
|
-
throw this.annotateConnectionError(new driver_utils_1.NonRetryableError("Websocket token is null", odsp_driver_definitions_1.OdspErrorType.fetchTokenError, { driverVersion: packageVersion_1.pkgVersion }), "getWebsocketToken", !requestWebsocketTokenFromJoinSession);
|
|
166
|
-
}
|
|
167
|
-
try {
|
|
168
|
-
const connection = await this.createDeltaConnection(websocketEndpoint.tenantId, websocketEndpoint.id, finalWebsocketToken, io, client, websocketEndpoint.deltaStreamSocketUrl);
|
|
169
|
-
connection.on("op", (documentId, ops) => {
|
|
170
|
-
this.opsReceived(ops);
|
|
171
|
-
});
|
|
172
|
-
// On disconnect with 401/403 error code, we can just clear the joinSession cache as we will again
|
|
173
|
-
// get the auth error on reconnecting and face latency.
|
|
174
|
-
connection.once("disconnect", (error) => {
|
|
175
|
-
// Clear the join session refresh timer so that it can be restarted on reconnection.
|
|
176
|
-
this.clearJoinSessionTimer();
|
|
177
|
-
if (typeof error === "object" && error !== null
|
|
178
|
-
&& error.errorType === driver_definitions_1.DriverErrorType.authorizationError) {
|
|
179
|
-
this.cache.sessionJoinCache.remove(this.joinSessionKey);
|
|
180
|
-
}
|
|
181
|
-
// If we hit this assert, it means that "disconnect" event is emitted before the connection went through
|
|
182
|
-
// dispose flow which is not correct and could lead to a bunch of erros.
|
|
183
|
-
(0, common_utils_1.assert)(connection.disposed, 0x4ae /* Connection should be disposed by now */);
|
|
184
|
-
this.currentConnection = undefined;
|
|
185
|
-
});
|
|
186
|
-
this.currentConnection = connection;
|
|
187
|
-
return connection;
|
|
188
|
-
}
|
|
189
|
-
catch (error) {
|
|
190
|
-
this.cache.sessionJoinCache.remove(this.joinSessionKey);
|
|
191
|
-
const normalizedError = this.annotateConnectionError(error, "createDeltaConnection", !requestWebsocketTokenFromJoinSession);
|
|
192
|
-
if (typeof error === "object" && error !== null) {
|
|
193
|
-
normalizedError.addTelemetryProperties({ socketDocumentId: websocketEndpoint.id });
|
|
194
|
-
}
|
|
195
|
-
throw normalizedError;
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
clearJoinSessionTimer() {
|
|
200
|
-
if (this.joinSessionRefreshTimer !== undefined) {
|
|
201
|
-
clearTimeout(this.joinSessionRefreshTimer);
|
|
202
|
-
this.joinSessionRefreshTimer = undefined;
|
|
158
|
+
if (this.socketModuleP === undefined) {
|
|
159
|
+
this.socketModuleP = this.getDelayLoadedDeltaStream();
|
|
203
160
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}, delta);
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
async joinSession(requestSocketToken, options) {
|
|
218
|
-
const response = await this.joinSessionCore(requestSocketToken, options).catch((e) => {
|
|
219
|
-
if ((0, odsp_doclib_utils_1.hasFacetCodes)(e) && e.facetCodes !== undefined) {
|
|
220
|
-
for (const code of e.facetCodes) {
|
|
221
|
-
switch (code) {
|
|
222
|
-
case "sessionForbiddenOnPreservedFiles":
|
|
223
|
-
case "sessionForbiddenOnModerationEnabledLibrary":
|
|
224
|
-
case "sessionForbiddenOnRequireCheckout":
|
|
225
|
-
// This document can only be opened in storage-only mode.
|
|
226
|
-
// DeltaManager will recognize this error
|
|
227
|
-
// and load without a delta stream connection.
|
|
228
|
-
this._policies = Object.assign(Object.assign({}, this._policies), { storageOnly: true });
|
|
229
|
-
throw new driver_utils_1.DeltaStreamConnectionForbiddenError(code, { driverVersion: packageVersion_1.pkgVersion });
|
|
230
|
-
default:
|
|
231
|
-
continue;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
throw e;
|
|
161
|
+
return this.socketModuleP
|
|
162
|
+
.then(async (m) => {
|
|
163
|
+
this.odspSocketModuleLoaded = true;
|
|
164
|
+
return m.connectToDeltaStream(client);
|
|
165
|
+
})
|
|
166
|
+
.catch((error) => {
|
|
167
|
+
// Setting undefined in case someone tries to recover from module failure by calling again.
|
|
168
|
+
this.socketModuleP = undefined;
|
|
169
|
+
this.odspSocketModuleLoaded = false;
|
|
170
|
+
throw error;
|
|
236
171
|
});
|
|
237
|
-
this.relayServiceTenantAndSessionId = `${response.tenantId}/${response.id}`;
|
|
238
|
-
return response;
|
|
239
|
-
}
|
|
240
|
-
async joinSessionCore(requestSocketToken, options) {
|
|
241
|
-
const disableJoinSessionRefresh = this.mc.config.getBoolean("Fluid.Driver.Odsp.disableJoinSessionRefresh");
|
|
242
|
-
const executeFetch = async () => {
|
|
243
|
-
var _a;
|
|
244
|
-
const joinSessionResponse = await (0, vroom_1.fetchJoinSession)(this.odspResolvedUrl, "opStream/joinSession", "POST", this.mc.logger, this.getStorageToken, this.epochTracker, requestSocketToken, options, disableJoinSessionRefresh, (_a = this.hostPolicy.sessionOptions) === null || _a === void 0 ? void 0 : _a.unauthenticatedUserDisplayName);
|
|
245
|
-
return {
|
|
246
|
-
entryTime: Date.now(),
|
|
247
|
-
joinSessionResponse,
|
|
248
|
-
};
|
|
249
|
-
};
|
|
250
|
-
const getResponseAndRefreshAfterDeltaMs = async () => {
|
|
251
|
-
var _a;
|
|
252
|
-
const _response = await this.cache.sessionJoinCache.addOrGet(this.joinSessionKey, executeFetch);
|
|
253
|
-
// If the response does not contain refreshSessionDurationSeconds, then treat it as old flow and let the
|
|
254
|
-
// cache entry to be treated as expired after 1 hour.
|
|
255
|
-
_response.joinSessionResponse.refreshSessionDurationSeconds =
|
|
256
|
-
(_a = _response.joinSessionResponse.refreshSessionDurationSeconds) !== null && _a !== void 0 ? _a : 3600;
|
|
257
|
-
return Object.assign(Object.assign({}, _response), { refreshAfterDeltaMs: this.calculateJoinSessionRefreshDelta(_response.entryTime, _response.joinSessionResponse.refreshSessionDurationSeconds) });
|
|
258
|
-
};
|
|
259
|
-
let response = await getResponseAndRefreshAfterDeltaMs();
|
|
260
|
-
// This means that the cached entry has expired(This should not be possible if the response is fetched
|
|
261
|
-
// from the network call). In this case we remove the cached entry and fetch the new response.
|
|
262
|
-
if (response.refreshAfterDeltaMs <= 0) {
|
|
263
|
-
this.cache.sessionJoinCache.remove(this.joinSessionKey);
|
|
264
|
-
response = await getResponseAndRefreshAfterDeltaMs();
|
|
265
|
-
}
|
|
266
|
-
if (!disableJoinSessionRefresh) {
|
|
267
|
-
const props = {
|
|
268
|
-
entryTime: response.entryTime,
|
|
269
|
-
refreshSessionDurationSeconds: response.joinSessionResponse.refreshSessionDurationSeconds,
|
|
270
|
-
refreshAfterDeltaMs: response.refreshAfterDeltaMs,
|
|
271
|
-
};
|
|
272
|
-
if (response.refreshAfterDeltaMs > 0) {
|
|
273
|
-
this.scheduleJoinSessionRefresh(response.refreshAfterDeltaMs)
|
|
274
|
-
.catch((error) => {
|
|
275
|
-
const canRetry = (0, driver_utils_1.canRetryOnError)(error);
|
|
276
|
-
// Only record error event in case it is non retriable.
|
|
277
|
-
if (!canRetry) {
|
|
278
|
-
this.mc.logger.sendErrorEvent({
|
|
279
|
-
eventName: "JoinSessionRefreshError",
|
|
280
|
-
details: JSON.stringify(props),
|
|
281
|
-
}, error);
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
// Logging just for informational purposes to help with debugging as this is a new feature.
|
|
287
|
-
this.mc.logger.sendTelemetryEvent({
|
|
288
|
-
eventName: "JoinSessionRefreshNotScheduled",
|
|
289
|
-
details: JSON.stringify(props),
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
return response.joinSessionResponse;
|
|
294
|
-
}
|
|
295
|
-
calculateJoinSessionRefreshDelta(responseFetchTime, refreshSessionDurationSeconds) {
|
|
296
|
-
// 30 seconds is buffer time to refresh the session.
|
|
297
|
-
return responseFetchTime + ((refreshSessionDurationSeconds * 1000) - 30000) - Date.now();
|
|
298
172
|
}
|
|
299
173
|
/**
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
* @
|
|
304
|
-
* @param token - authorization token for delta service
|
|
305
|
-
* @param io - websocket library
|
|
306
|
-
* @param client - information about the client
|
|
307
|
-
* @param webSocketUrl - websocket URL
|
|
174
|
+
* This dynamically imports the module for loading the delta connection. In many cases the delta stream, is not
|
|
175
|
+
* required during the critical load flow. So this way we don't have to bundle this in the initial bundle and can
|
|
176
|
+
* import this later on when required.
|
|
177
|
+
* @returns - delta stream object.
|
|
308
178
|
*/
|
|
309
|
-
async
|
|
310
|
-
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}
|
|
322
|
-
return connection;
|
|
179
|
+
async getDelayLoadedDeltaStream() {
|
|
180
|
+
(0, common_utils_1.assert)(this.odspSocketModuleLoaded === false, 0x507 /* Should be loaded only once */);
|
|
181
|
+
const module = await Promise.resolve().then(() => __importStar(require(/* webpackChunkName: "socketModule" */ "./odspDelayLoadedDeltaStream"))).then((m) => {
|
|
182
|
+
this.mc.logger.sendTelemetryEvent({ eventName: "SocketModuleLoaded" });
|
|
183
|
+
return m;
|
|
184
|
+
})
|
|
185
|
+
.catch((error) => {
|
|
186
|
+
this.mc.logger.sendErrorEvent({ eventName: "SocketModuleLoadFailed" }, error);
|
|
187
|
+
throw error;
|
|
188
|
+
});
|
|
189
|
+
this.odspDelayLoadedDeltaStream = new module.OdspDelayLoadedDeltaStream(this.odspResolvedUrl, this._policies, this.getStorageToken, this.getWebsocketToken, this.mc, this.cache, this.hostPolicy, this.epochTracker, (ops) => this.opsReceived(ops), this.socketReferenceKeyPrefix);
|
|
190
|
+
return this.odspDelayLoadedDeltaStream;
|
|
323
191
|
}
|
|
324
192
|
dispose(error) {
|
|
325
193
|
var _a, _b, _c;
|
|
@@ -334,9 +202,8 @@ class OdspDocumentService {
|
|
|
334
202
|
(_a = this._opsCache) === null || _a === void 0 ? void 0 : _a.flushOps();
|
|
335
203
|
}
|
|
336
204
|
(_b = this._opsCache) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
337
|
-
this.
|
|
338
|
-
(_c = this.
|
|
339
|
-
this.currentConnection = undefined;
|
|
205
|
+
// Only need to dipose this, if it is already loaded.
|
|
206
|
+
(_c = this.odspDelayLoadedDeltaStream) === null || _c === void 0 ? void 0 : _c.dispose();
|
|
340
207
|
}
|
|
341
208
|
get opsCache() {
|
|
342
209
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspDocumentService.js","sourceRoot":"","sources":["../src/odspDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH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AAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE;YACrD,OAAO;SACV;QAED,MAAA,IAAI,CAAC,QAAQ,0CAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;CACJ;AAtfD,kDAsfC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { assert, performance } from \"@fluidframework/common-utils\";\nimport {\n ChildLogger,\n IFluidErrorBase,\n loggerToMonitoringContext,\n MonitoringContext,\n normalizeError,\n} from \"@fluidframework/telemetry-utils\";\nimport {\n IDocumentDeltaConnection,\n IDocumentDeltaStorageService,\n IDocumentService,\n IResolvedUrl,\n IDocumentStorageService,\n IDocumentServicePolicies,\n DriverErrorType,\n} from \"@fluidframework/driver-definitions\";\nimport { canRetryOnError, DeltaStreamConnectionForbiddenError, NonRetryableError } from \"@fluidframework/driver-utils\";\nimport {\n IClient,\n ISequencedDocumentMessage,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n IOdspResolvedUrl,\n TokenFetchOptions,\n IEntry,\n HostStoragePolicy,\n InstrumentedStorageTokenFetcher,\n OdspErrorType,\n} from \"@fluidframework/odsp-driver-definitions\";\nimport { hasFacetCodes } from \"@fluidframework/odsp-doclib-utils\";\nimport type { io as SocketIOClientStatic } from \"socket.io-client\";\nimport { HostStoragePolicyInternal, ISocketStorageDiscovery } from \"./contracts\";\nimport { IOdspCache } from \"./odspCache\";\nimport { OdspDeltaStorageService, OdspDeltaStorageWithCache } from \"./odspDeltaStorageService\";\nimport { OdspDocumentDeltaConnection } from \"./odspDocumentDeltaConnection\";\nimport { OdspDocumentStorageService } from \"./odspDocumentStorageManager\";\nimport { getWithRetryForTokenRefresh, getOdspResolvedUrl, TokenFetchOptionsEx } from \"./odspUtils\";\nimport { fetchJoinSession } from \"./vroom\";\nimport { isOdcOrigin } from \"./odspUrlHelper\";\nimport { EpochTracker } from \"./epochTracker\";\nimport { OpsCache } from \"./opsCaching\";\nimport { RetryErrorsStorageAdapter } from \"./retryErrorsStorageAdapter\";\nimport { pkgVersion as driverVersion } from \"./packageVersion\";\n\n/**\n * The DocumentService manages the Socket.IO connection and manages routing requests to connected\n * clients\n */\nexport class OdspDocumentService implements IDocumentService {\n private _policies: IDocumentServicePolicies;\n // Timer which runs and executes the join session call after intervals.\n private joinSessionRefreshTimer: ReturnType<typeof setTimeout> | undefined;\n /**\n * @param resolvedUrl - resolved url identifying document that will be managed by returned service instance.\n * @param getStorageToken - function that can provide the storage token. This is is also referred to as\n * the \"Vroom\" token in SPO.\n * @param getWebsocketToken - function that can provide a token for accessing the web socket. This is also referred\n * to as the \"Push\" token in SPO. If undefined then websocket token is expected to be returned with joinSession\n * response payload.\n * @param logger - a logger that can capture performance and diagnostic information\n * @param socketIoClientFactory - A factory that returns a promise to the socket io library required by the driver\n * @param cache - This caches response for joinSession.\n * @param hostPolicy - This host constructed policy which customizes service behavior.\n * @param epochTracker - This helper class which adds epoch to backend calls made by returned service instance.\n * @param socketReferenceKeyPrefix - (optional) prefix to isolate socket reuse cache\n */\n public static async create(\n resolvedUrl: IResolvedUrl,\n getStorageToken: InstrumentedStorageTokenFetcher,\n getWebsocketToken: ((options: TokenFetchOptions) => Promise<string | null>) | undefined,\n logger: ITelemetryLogger,\n socketIoClientFactory: () => Promise<typeof SocketIOClientStatic>,\n cache: IOdspCache,\n hostPolicy: HostStoragePolicy,\n epochTracker: EpochTracker,\n socketReferenceKeyPrefix?: string,\n clientIsSummarizer?: boolean,\n ): Promise<IDocumentService> {\n return new OdspDocumentService(\n getOdspResolvedUrl(resolvedUrl),\n getStorageToken,\n getWebsocketToken,\n logger,\n socketIoClientFactory,\n cache,\n hostPolicy,\n epochTracker,\n socketReferenceKeyPrefix,\n clientIsSummarizer,\n );\n }\n\n private storageManager?: OdspDocumentStorageService;\n\n private readonly mc: MonitoringContext;\n\n private readonly joinSessionKey: string;\n\n private readonly hostPolicy: HostStoragePolicyInternal;\n\n private _opsCache?: OpsCache;\n\n private currentConnection?: OdspDocumentDeltaConnection;\n\n private relayServiceTenantAndSessionId: string | undefined;\n\n /**\n * @param odspResolvedUrl - resolved url identifying document that will be managed by this service instance.\n * @param getStorageToken - function that can provide the storage token. This is is also referred to as\n * the \"Vroom\" token in SPO.\n * @param getWebsocketToken - function that can provide a token for accessing the web socket. This is also referred\n * to as the \"Push\" token in SPO. If undefined then websocket token is expected to be returned with joinSession\n * response payload.\n * @param logger - a logger that can capture performance and diagnostic information\n * @param socketIoClientFactory - A factory that returns a promise to the socket io library required by the driver\n * @param cache - This caches response for joinSession.\n * @param hostPolicy - host constructed policy which customizes service behavior.\n * @param epochTracker - This helper class which adds epoch to backend calls made by this service instance.\n * @param socketReferenceKeyPrefix - (optional) prefix to isolate socket reuse cache\n */\n private constructor(\n public readonly odspResolvedUrl: IOdspResolvedUrl,\n private readonly getStorageToken: InstrumentedStorageTokenFetcher,\n private readonly getWebsocketToken: ((options: TokenFetchOptions) => Promise<string | null>) | undefined,\n logger: ITelemetryLogger,\n private readonly socketIoClientFactory: () => Promise<typeof SocketIOClientStatic>,\n private readonly cache: IOdspCache,\n hostPolicy: HostStoragePolicy,\n private readonly epochTracker: EpochTracker,\n private readonly socketReferenceKeyPrefix?: string,\n private readonly clientIsSummarizer?: boolean,\n ) {\n this._policies = {\n // load in storage-only mode if a file version is specified\n storageOnly: odspResolvedUrl.fileVersion !== undefined,\n };\n\n this.joinSessionKey = `${this.odspResolvedUrl.hashedDocumentId}/joinsession`;\n this.mc = loggerToMonitoringContext(\n ChildLogger.create(logger,\n undefined,\n {\n all: {\n odc: isOdcOrigin(new URL(this.odspResolvedUrl.endpoints.snapshotStorageUrl).origin),\n },\n }));\n\n this.hostPolicy = hostPolicy;\n if (this.clientIsSummarizer) {\n this.hostPolicy = { ...this.hostPolicy, summarizerClient: true };\n }\n }\n\n public get resolvedUrl(): IResolvedUrl {\n return this.odspResolvedUrl;\n }\n public get policies() {\n return this._policies;\n }\n\n /**\n * Connects to a storage endpoint for snapshot service.\n *\n * @returns returns the document storage service for sharepoint driver.\n */\n public async connectToStorage(): Promise<IDocumentStorageService> {\n if (!this.storageManager) {\n this.storageManager = new OdspDocumentStorageService(\n this.odspResolvedUrl,\n this.getStorageToken,\n this.mc.logger,\n true,\n this.cache,\n this.hostPolicy,\n this.epochTracker,\n // flushCallback\n async () => {\n if (this.currentConnection !== undefined && !this.currentConnection.disposed) {\n return this.currentConnection.flush();\n }\n throw new Error(\"Disconnected while uploading summary (attempt to perform flush())\");\n },\n () => {\n return this.relayServiceTenantAndSessionId;\n },\n this.mc.config.getNumber(\"Fluid.Driver.Odsp.snapshotFormatFetchType\"),\n );\n }\n\n return new RetryErrorsStorageAdapter(this.storageManager, this.mc.logger);\n }\n\n /**\n * Connects to a delta storage endpoint for getting ops between a range.\n *\n * @returns returns the document delta storage service for sharepoint driver.\n */\n public async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n const snapshotOps = this.storageManager?.ops ?? [];\n const service = new OdspDeltaStorageService(\n this.odspResolvedUrl.endpoints.deltaStorageUrl,\n this.getStorageToken,\n this.epochTracker,\n this.mc.logger,\n );\n\n // batch size, please see issue #5211 for data around batch sizing\n const batchSize = this.hostPolicy.opsBatchSize ?? 5000;\n const concurrency = this.hostPolicy.concurrentOpsBatches ?? 1;\n return new OdspDeltaStorageWithCache(\n snapshotOps,\n this.mc.logger,\n batchSize,\n concurrency,\n async (from, to, telemetryProps, fetchReason) => service.get(from, to, telemetryProps, fetchReason),\n async (from, to) => {\n const res = await this.opsCache?.get(from, to);\n return res as ISequencedDocumentMessage[] ?? [];\n },\n (from, to) => {\n if (this.currentConnection !== undefined && !this.currentConnection.disposed) {\n this.currentConnection.requestOps(from, to);\n }\n },\n (ops: ISequencedDocumentMessage[]) => this.opsReceived(ops),\n );\n }\n\n /** Annotate the given error indicating which connection step failed */\n private annotateConnectionError(\n error: any,\n failedConnectionStep: string,\n separateTokenRequest: boolean,\n ): IFluidErrorBase {\n return normalizeError(error, { props: {\n failedConnectionStep,\n separateTokenRequest,\n } });\n }\n\n /**\n * Connects to a delta stream endpoint for emitting ops.\n *\n * @returns returns the document delta stream service for onedrive/sharepoint driver.\n */\n public async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n assert(this.currentConnection === undefined, 0x4ad /* Should not be called when connection is already present! */);\n // Attempt to connect twice, in case we used expired token.\n return getWithRetryForTokenRefresh<IDocumentDeltaConnection>(async (options) => {\n // Presence of getWebsocketToken callback dictates whether callback is used for fetching\n // websocket token or whether it is returned with joinSession response payload\n const requestWebsocketTokenFromJoinSession = this.getWebsocketToken === undefined;\n const websocketTokenPromise = requestWebsocketTokenFromJoinSession\n ? Promise.resolve(null)\n : this.getWebsocketToken!(options);\n\n const annotateAndRethrowConnectionError = (step: string) => (error: any) => {\n throw this.annotateConnectionError(error, step, !requestWebsocketTokenFromJoinSession);\n };\n\n const joinSessionPromise = this.joinSession(requestWebsocketTokenFromJoinSession, options);\n const [websocketEndpoint, websocketToken, io] =\n await Promise.all([\n joinSessionPromise.catch(annotateAndRethrowConnectionError(\"joinSession\")),\n websocketTokenPromise.catch(annotateAndRethrowConnectionError(\"getWebsocketToken\")),\n this.socketIoClientFactory().catch(annotateAndRethrowConnectionError(\"socketIoClientFactory\")),\n ]);\n\n const finalWebsocketToken = websocketToken ?? (websocketEndpoint.socketToken ?? null);\n if (finalWebsocketToken === null) {\n throw this.annotateConnectionError(\n new NonRetryableError(\n \"Websocket token is null\",\n OdspErrorType.fetchTokenError,\n { driverVersion },\n ),\n \"getWebsocketToken\",\n !requestWebsocketTokenFromJoinSession);\n }\n try {\n const connection = await this.createDeltaConnection(\n websocketEndpoint.tenantId,\n websocketEndpoint.id,\n finalWebsocketToken,\n io,\n client,\n websocketEndpoint.deltaStreamSocketUrl);\n connection.on(\"op\", (documentId, ops: ISequencedDocumentMessage[]) => {\n this.opsReceived(ops);\n });\n // On disconnect with 401/403 error code, we can just clear the joinSession cache as we will again\n // get the auth error on reconnecting and face latency.\n connection.once(\"disconnect\", (error: any) => {\n // Clear the join session refresh timer so that it can be restarted on reconnection.\n this.clearJoinSessionTimer();\n if (typeof error === \"object\" && error !== null\n && error.errorType === DriverErrorType.authorizationError) {\n this.cache.sessionJoinCache.remove(this.joinSessionKey);\n }\n // If we hit this assert, it means that \"disconnect\" event is emitted before the connection went through\n // dispose flow which is not correct and could lead to a bunch of erros.\n assert(connection.disposed, 0x4ae /* Connection should be disposed by now */);\n this.currentConnection = undefined;\n });\n this.currentConnection = connection;\n return connection;\n } catch (error) {\n this.cache.sessionJoinCache.remove(this.joinSessionKey);\n\n const normalizedError = this.annotateConnectionError(\n error,\n \"createDeltaConnection\",\n !requestWebsocketTokenFromJoinSession);\n if (typeof error === \"object\" && error !== null) {\n normalizedError.addTelemetryProperties({ socketDocumentId: websocketEndpoint.id });\n }\n throw normalizedError;\n }\n });\n }\n\n private clearJoinSessionTimer() {\n if (this.joinSessionRefreshTimer !== undefined) {\n clearTimeout(this.joinSessionRefreshTimer);\n this.joinSessionRefreshTimer = undefined;\n }\n }\n\n private async scheduleJoinSessionRefresh(delta: number) {\n await new Promise<void>((resolve, reject) => {\n this.joinSessionRefreshTimer = setTimeout(() => {\n getWithRetryForTokenRefresh(async (options) => {\n await this.joinSession(false, options);\n resolve();\n }).catch((error) => {\n reject(error);\n });\n }, delta);\n });\n }\n\n private async joinSession(\n requestSocketToken: boolean,\n options: TokenFetchOptionsEx,\n ) {\n const response = await this.joinSessionCore(requestSocketToken, options).catch((e) => {\n if (hasFacetCodes(e) && e.facetCodes !== undefined) {\n for (const code of e.facetCodes) {\n switch (code) {\n case \"sessionForbiddenOnPreservedFiles\":\n case \"sessionForbiddenOnModerationEnabledLibrary\":\n case \"sessionForbiddenOnRequireCheckout\":\n // This document can only be opened in storage-only mode.\n // DeltaManager will recognize this error\n // and load without a delta stream connection.\n this._policies = { ...this._policies, storageOnly: true };\n throw new DeltaStreamConnectionForbiddenError(code, { driverVersion });\n default:\n continue;\n }\n }\n }\n throw e;\n });\n this.relayServiceTenantAndSessionId = `${response.tenantId}/${response.id}`;\n return response;\n }\n\n private async joinSessionCore(\n requestSocketToken: boolean,\n options: TokenFetchOptionsEx,\n ): Promise<ISocketStorageDiscovery> {\n const disableJoinSessionRefresh = this.mc.config.getBoolean(\"Fluid.Driver.Odsp.disableJoinSessionRefresh\");\n const executeFetch = async () => {\n const joinSessionResponse = await fetchJoinSession(\n this.odspResolvedUrl,\n \"opStream/joinSession\",\n \"POST\",\n this.mc.logger,\n this.getStorageToken,\n this.epochTracker,\n requestSocketToken,\n options,\n disableJoinSessionRefresh,\n this.hostPolicy.sessionOptions?.unauthenticatedUserDisplayName,\n );\n return {\n entryTime: Date.now(),\n joinSessionResponse,\n };\n };\n\n const getResponseAndRefreshAfterDeltaMs = async () => {\n const _response = await this.cache.sessionJoinCache.addOrGet(this.joinSessionKey, executeFetch);\n // If the response does not contain refreshSessionDurationSeconds, then treat it as old flow and let the\n // cache entry to be treated as expired after 1 hour.\n _response.joinSessionResponse.refreshSessionDurationSeconds =\n _response.joinSessionResponse.refreshSessionDurationSeconds ?? 3600;\n return {\n ..._response,\n refreshAfterDeltaMs: this.calculateJoinSessionRefreshDelta(\n _response.entryTime, _response.joinSessionResponse.refreshSessionDurationSeconds),\n };\n };\n let response = await getResponseAndRefreshAfterDeltaMs();\n // This means that the cached entry has expired(This should not be possible if the response is fetched\n // from the network call). In this case we remove the cached entry and fetch the new response.\n if (response.refreshAfterDeltaMs <= 0) {\n this.cache.sessionJoinCache.remove(this.joinSessionKey);\n response = await getResponseAndRefreshAfterDeltaMs();\n }\n if (!disableJoinSessionRefresh) {\n const props = {\n entryTime: response.entryTime,\n refreshSessionDurationSeconds:\n response.joinSessionResponse.refreshSessionDurationSeconds,\n refreshAfterDeltaMs: response.refreshAfterDeltaMs,\n };\n if (response.refreshAfterDeltaMs > 0) {\n this.scheduleJoinSessionRefresh(response.refreshAfterDeltaMs)\n .catch((error) => {\n const canRetry = canRetryOnError(error);\n // Only record error event in case it is non retriable.\n if (!canRetry) {\n this.mc.logger.sendErrorEvent({\n eventName: \"JoinSessionRefreshError\",\n details: JSON.stringify(props),\n },\n error,\n );\n }\n });\n } else {\n // Logging just for informational purposes to help with debugging as this is a new feature.\n this.mc.logger.sendTelemetryEvent({\n eventName: \"JoinSessionRefreshNotScheduled\",\n details: JSON.stringify(props),\n });\n }\n }\n return response.joinSessionResponse;\n }\n\n private calculateJoinSessionRefreshDelta(responseFetchTime: number, refreshSessionDurationSeconds: number) {\n // 30 seconds is buffer time to refresh the session.\n return responseFetchTime + ((refreshSessionDurationSeconds * 1000) - 30000) - Date.now();\n }\n\n /**\n * Creats a connection to the given delta stream endpoint\n *\n * @param tenantId - the ID of the tenant\n * @param documentId - document ID\n * @param token - authorization token for delta service\n * @param io - websocket library\n * @param client - information about the client\n * @param webSocketUrl - websocket URL\n */\n private async createDeltaConnection(\n tenantId: string,\n documentId: string,\n token: string | null,\n io: typeof SocketIOClientStatic,\n client: IClient,\n webSocketUrl: string,\n ): Promise<OdspDocumentDeltaConnection> {\n const startTime = performance.now();\n const connection = await OdspDocumentDeltaConnection.create(\n tenantId,\n documentId,\n token,\n io,\n client,\n webSocketUrl,\n this.mc.logger,\n 60000,\n this.epochTracker,\n this.socketReferenceKeyPrefix,\n );\n const duration = performance.now() - startTime;\n // This event happens rather often, so it adds up to cost of telemetry.\n // Given that most reconnects result in reusing socket and happen very quickly,\n // report event only if it took longer than threshold.\n if (duration >= 2000) {\n this.mc.logger.sendPerformanceEvent({\n eventName: \"ConnectionSuccess\",\n duration,\n });\n }\n return connection;\n }\n\n public dispose(error?: any) {\n // Error might indicate mismatch between client & server knowlege about file\n // (DriverErrorType.fileOverwrittenInStorage).\n // For example, file might have been overwritten in storage without generating new epoch\n // In such case client cached info is stale and has to be removed.\n if (error !== undefined) {\n this.epochTracker.removeEntries().catch(() => {});\n } else {\n this._opsCache?.flushOps();\n }\n this._opsCache?.dispose();\n this.clearJoinSessionTimer();\n this.currentConnection?.dispose();\n this.currentConnection = undefined;\n }\n\n protected get opsCache() {\n if (this._opsCache) {\n return this._opsCache;\n }\n\n const seqNumber = this.storageManager?.snapshotSequenceNumber;\n const batchSize = this.hostPolicy.opsCaching?.batchSize ?? 100;\n if (seqNumber === undefined || batchSize < 1) {\n return;\n }\n\n const opsKey: Omit<IEntry, \"key\"> = {\n type: \"ops\",\n };\n this._opsCache = new OpsCache(\n seqNumber,\n this.mc.logger,\n // ICache\n {\n write: async (key: string, opsData: string) => {\n return this.cache.persistedCache.put({ ...opsKey, key }, opsData);\n },\n read: async (key: string) => this.cache.persistedCache.get({ ...opsKey, key }),\n remove: () => { this.cache.persistedCache.removeEntries().catch(() => {}); },\n },\n batchSize,\n this.hostPolicy.opsCaching?.timerGranularity ?? 5000,\n this.hostPolicy.opsCaching?.totalOpsToCache ?? 5000,\n );\n return this._opsCache;\n }\n\n // Called whenever re receive ops through any channel for this document (snapshot, delta connection, delta storage)\n // We use it to notify caching layer of how stale is snapshot stored in cache.\n protected opsReceived(ops: ISequencedDocumentMessage[]) {\n // No need for two clients to save same ops\n if (ops.length === 0 || this.odspResolvedUrl.summarizer) {\n return;\n }\n\n this.opsCache?.addOps(ops);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"odspDocumentService.js","sourceRoot":"","sources":["../src/odspDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;AAGH,+DAAsD;AACtD,qEAIyC;AAsBzC,uEAA+F;AAC/F,6EAA0E;AAC1E,2CAAiD;AACjD,mDAA8C;AAE9C,6CAAwC;AACxC,2EAAwE;AAGxE;;;GAGG;AACH,MAAa,mBAAmB;IAuD5B;;;;;;;;;;;;;OAaG;IACH,YACoB,eAAiC,EAChC,eAAgD,EAChD,iBAAuF,EACxG,MAAwB,EACP,KAAiB,EAClC,UAA6B,EACZ,YAA0B,EAC1B,wBA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E,OAAe,EAAE,EAAE;gBAC1C,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,iCAAM,MAAM,KAAE,GAAG,KAAI,OAAO,CAAC,CAAC;YACtE,CAAC;YACD,IAAI,EAAE,KAAK,EAAE,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,iCAAM,MAAM,KAAE,GAAG,IAAG;YAC9E,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC,CAAC;SAC/E,EACD,SAAS,EACT,MAAA,MAAA,IAAI,CAAC,UAAU,CAAC,UAAU,0CAAE,gBAAgB,mCAAI,IAAI,EACpD,MAAA,MAAA,IAAI,CAAC,UAAU,CAAC,UAAU,0CAAE,eAAe,mCAAI,IAAI,CACtD,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,mHAAmH;IACnH,8EAA8E;IACpE,WAAW,CAAC,GAAgC;;QAClD,2CAA2C;QAC3C,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE;YACrD,OAAO;SACV;QAED,MAAA,IAAI,CAAC,QAAQ,0CAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;CACJ;AAnSD,kDAmSC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { assert } from \"@fluidframework/common-utils\";\nimport {\n ChildLogger,\n loggerToMonitoringContext,\n MonitoringContext,\n} from \"@fluidframework/telemetry-utils\";\nimport {\n IDocumentDeltaConnection,\n IDocumentDeltaStorageService,\n IDocumentService,\n IResolvedUrl,\n IDocumentStorageService,\n IDocumentServicePolicies,\n} from \"@fluidframework/driver-definitions\";\nimport {\n IClient,\n ISequencedDocumentMessage,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n IOdspResolvedUrl,\n TokenFetchOptions,\n IEntry,\n HostStoragePolicy,\n InstrumentedStorageTokenFetcher,\n} from \"@fluidframework/odsp-driver-definitions\";\nimport { HostStoragePolicyInternal } from \"./contracts\";\nimport { IOdspCache } from \"./odspCache\";\nimport { OdspDeltaStorageService, OdspDeltaStorageWithCache } from \"./odspDeltaStorageService\";\nimport { OdspDocumentStorageService } from \"./odspDocumentStorageManager\";\nimport { getOdspResolvedUrl } from \"./odspUtils\";\nimport { isOdcOrigin } from \"./odspUrlHelper\";\nimport { EpochTracker } from \"./epochTracker\";\nimport { OpsCache } from \"./opsCaching\";\nimport { RetryErrorsStorageAdapter } from \"./retryErrorsStorageAdapter\";\nimport type { OdspDelayLoadedDeltaStream } from \"./odspDelayLoadedDeltaStream\";\n\n/**\n * The DocumentService manages the Socket.IO connection and manages routing requests to connected\n * clients\n */\nexport class OdspDocumentService implements IDocumentService {\n private readonly _policies: IDocumentServicePolicies;\n\n // Promise to load socket module only once.\n private socketModuleP: Promise<OdspDelayLoadedDeltaStream> | undefined;\n\n private odspDelayLoadedDeltaStream: OdspDelayLoadedDeltaStream | undefined;\n\n private odspSocketModuleLoaded: boolean = false;\n\n /**\n * @param resolvedUrl - resolved url identifying document that will be managed by returned service instance.\n * @param getStorageToken - function that can provide the storage token. This is is also referred to as\n * the \"Vroom\" token in SPO.\n * @param getWebsocketToken - function that can provide a token for accessing the web socket. This is also referred\n * to as the \"Push\" token in SPO. If undefined then websocket token is expected to be returned with joinSession\n * response payload.\n * @param logger - a logger that can capture performance and diagnostic information\n * @param cache - This caches response for joinSession.\n * @param hostPolicy - This host constructed policy which customizes service behavior.\n * @param epochTracker - This helper class which adds epoch to backend calls made by returned service instance.\n * @param socketReferenceKeyPrefix - (optional) prefix to isolate socket reuse cache\n */\n public static async create(\n resolvedUrl: IResolvedUrl,\n getStorageToken: InstrumentedStorageTokenFetcher,\n getWebsocketToken: ((options: TokenFetchOptions) => Promise<string | null>) | undefined,\n logger: ITelemetryLogger,\n cache: IOdspCache,\n hostPolicy: HostStoragePolicy,\n epochTracker: EpochTracker,\n socketReferenceKeyPrefix?: string,\n clientIsSummarizer?: boolean,\n ): Promise<IDocumentService> {\n return new OdspDocumentService(\n getOdspResolvedUrl(resolvedUrl),\n getStorageToken,\n getWebsocketToken,\n logger,\n cache,\n hostPolicy,\n epochTracker,\n socketReferenceKeyPrefix,\n clientIsSummarizer,\n );\n }\n\n private storageManager?: OdspDocumentStorageService;\n\n private readonly mc: MonitoringContext;\n\n private readonly hostPolicy: HostStoragePolicyInternal;\n\n private _opsCache?: OpsCache;\n\n /**\n * @param odspResolvedUrl - resolved url identifying document that will be managed by this service instance.\n * @param getStorageToken - function that can provide the storage token. This is is also referred to as\n * the \"Vroom\" token in SPO.\n * @param getWebsocketToken - function that can provide a token for accessing the web socket. This is also referred\n * to as the \"Push\" token in SPO. If undefined then websocket token is expected to be returned with joinSession\n * response payload.\n * @param logger - a logger that can capture performance and diagnostic information\n * @param socketIoClientFactory - A factory that returns a promise to the socket io library required by the driver\n * @param cache - This caches response for joinSession.\n * @param hostPolicy - host constructed policy which customizes service behavior.\n * @param epochTracker - This helper class which adds epoch to backend calls made by this service instance.\n * @param socketReferenceKeyPrefix - (optional) prefix to isolate socket reuse cache\n */\n private constructor(\n public readonly odspResolvedUrl: IOdspResolvedUrl,\n private readonly getStorageToken: InstrumentedStorageTokenFetcher,\n private readonly getWebsocketToken: ((options: TokenFetchOptions) => Promise<string | null>) | undefined,\n logger: ITelemetryLogger,\n private readonly cache: IOdspCache,\n hostPolicy: HostStoragePolicy,\n private readonly epochTracker: EpochTracker,\n private readonly socketReferenceKeyPrefix?: string,\n private readonly clientIsSummarizer?: boolean,\n ) {\n this._policies = {\n // load in storage-only mode if a file version is specified\n storageOnly: odspResolvedUrl.fileVersion !== undefined,\n };\n\n this.mc = loggerToMonitoringContext(\n ChildLogger.create(logger,\n undefined,\n {\n all: {\n odc: isOdcOrigin(new URL(this.odspResolvedUrl.endpoints.snapshotStorageUrl).origin),\n },\n }));\n\n this.hostPolicy = hostPolicy;\n if (this.clientIsSummarizer) {\n this.hostPolicy = { ...this.hostPolicy, summarizerClient: true };\n }\n }\n\n public get resolvedUrl(): IResolvedUrl {\n return this.odspResolvedUrl;\n }\n public get policies() {\n return this._policies;\n }\n\n /**\n * Connects to a storage endpoint for snapshot service.\n *\n * @returns returns the document storage service for sharepoint driver.\n */\n public async connectToStorage(): Promise<IDocumentStorageService> {\n if (!this.storageManager) {\n this.storageManager = new OdspDocumentStorageService(\n this.odspResolvedUrl,\n this.getStorageToken,\n this.mc.logger,\n true,\n this.cache,\n this.hostPolicy,\n this.epochTracker,\n // flushCallback\n async () => {\n const currentConnection = this.odspDelayLoadedDeltaStream?.currentDeltaConnection;\n if (currentConnection !== undefined && !currentConnection.disposed) {\n return currentConnection.flush();\n }\n throw new Error(\"Disconnected while uploading summary (attempt to perform flush())\");\n },\n () => {\n return this.odspDelayLoadedDeltaStream?.relayServiceTenantAndSessionId;\n },\n this.mc.config.getNumber(\"Fluid.Driver.Odsp.snapshotFormatFetchType\"),\n );\n }\n\n return new RetryErrorsStorageAdapter(this.storageManager, this.mc.logger);\n }\n\n /**\n * Connects to a delta storage endpoint for getting ops between a range.\n *\n * @returns returns the document delta storage service for sharepoint driver.\n */\n public async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n const snapshotOps = this.storageManager?.ops ?? [];\n const service = new OdspDeltaStorageService(\n this.odspResolvedUrl.endpoints.deltaStorageUrl,\n this.getStorageToken,\n this.epochTracker,\n this.mc.logger,\n );\n\n // batch size, please see issue #5211 for data around batch sizing\n const batchSize = this.hostPolicy.opsBatchSize ?? 5000;\n const concurrency = this.hostPolicy.concurrentOpsBatches ?? 1;\n return new OdspDeltaStorageWithCache(\n snapshotOps,\n this.mc.logger,\n batchSize,\n concurrency,\n // Get Ops from storage callback.\n async (from, to, telemetryProps, fetchReason) => service.get(from, to, telemetryProps, fetchReason),\n // Get cachedOps Callback.\n async (from, to) => {\n const res = await this.opsCache?.get(from, to);\n return res as ISequencedDocumentMessage[] ?? [];\n },\n // Ops requestFromSocket Callback.\n (from, to) => {\n const currentConnection = this.odspDelayLoadedDeltaStream?.currentDeltaConnection;\n if (currentConnection !== undefined && !currentConnection.disposed) {\n currentConnection.requestOps(from, to);\n }\n },\n (ops: ISequencedDocumentMessage[]) => this.opsReceived(ops),\n );\n }\n\n /**\n * Connects to a delta stream endpoint for emitting ops.\n *\n * @returns returns the document delta stream service for onedrive/sharepoint driver.\n */\n public async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n if (this.socketModuleP === undefined) {\n this.socketModuleP = this.getDelayLoadedDeltaStream();\n }\n return this.socketModuleP\n .then(async (m) => {\n this.odspSocketModuleLoaded = true;\n return m.connectToDeltaStream(client);\n })\n .catch((error) => {\n // Setting undefined in case someone tries to recover from module failure by calling again.\n this.socketModuleP = undefined;\n this.odspSocketModuleLoaded = false;\n throw error;\n });\n }\n\n /**\n * This dynamically imports the module for loading the delta connection. In many cases the delta stream, is not\n * required during the critical load flow. So this way we don't have to bundle this in the initial bundle and can\n * import this later on when required.\n * @returns - delta stream object.\n */\n private async getDelayLoadedDeltaStream() {\n assert(this.odspSocketModuleLoaded === false, 0x507 /* Should be loaded only once */);\n const module = await import(/* webpackChunkName: \"socketModule\" */ \"./odspDelayLoadedDeltaStream\")\n .then((m) => {\n this.mc.logger.sendTelemetryEvent({ eventName: \"SocketModuleLoaded\" });\n return m;\n })\n .catch((error) => {\n this.mc.logger.sendErrorEvent( { eventName: \"SocketModuleLoadFailed\" }, error);\n throw error;\n });\n this.odspDelayLoadedDeltaStream = new module.OdspDelayLoadedDeltaStream(\n this.odspResolvedUrl,\n this._policies,\n this.getStorageToken,\n this.getWebsocketToken,\n this.mc,\n this.cache,\n this.hostPolicy,\n this.epochTracker,\n (ops: ISequencedDocumentMessage[]) => this.opsReceived(ops),\n this.socketReferenceKeyPrefix,\n );\n return this.odspDelayLoadedDeltaStream;\n }\n\n public dispose(error?: any) {\n // Error might indicate mismatch between client & server knowlege about file\n // (DriverErrorType.fileOverwrittenInStorage).\n // For example, file might have been overwritten in storage without generating new epoch\n // In such case client cached info is stale and has to be removed.\n if (error !== undefined) {\n this.epochTracker.removeEntries().catch(() => {});\n } else {\n this._opsCache?.flushOps();\n }\n this._opsCache?.dispose();\n // Only need to dipose this, if it is already loaded.\n this.odspDelayLoadedDeltaStream?.dispose();\n }\n\n protected get opsCache() {\n if (this._opsCache) {\n return this._opsCache;\n }\n\n const seqNumber = this.storageManager?.snapshotSequenceNumber;\n const batchSize = this.hostPolicy.opsCaching?.batchSize ?? 100;\n if (seqNumber === undefined || batchSize < 1) {\n return;\n }\n\n const opsKey: Omit<IEntry, \"key\"> = {\n type: \"ops\",\n };\n this._opsCache = new OpsCache(\n seqNumber,\n this.mc.logger,\n // ICache\n {\n write: async (key: string, opsData: string) => {\n return this.cache.persistedCache.put({ ...opsKey, key }, opsData);\n },\n read: async (key: string) => this.cache.persistedCache.get({ ...opsKey, key }),\n remove: () => { this.cache.persistedCache.removeEntries().catch(() => {}); },\n },\n batchSize,\n this.hostPolicy.opsCaching?.timerGranularity ?? 5000,\n this.hostPolicy.opsCaching?.totalOpsToCache ?? 5000,\n );\n return this._opsCache;\n }\n\n // Called whenever re receive ops through any channel for this document (snapshot, delta connection, delta storage)\n // We use it to notify caching layer of how stale is snapshot stored in cache.\n protected opsReceived(ops: ISequencedDocumentMessage[]) {\n // No need for two clients to save same ops\n if (ops.length === 0 || this.odspResolvedUrl.summarizer) {\n return;\n }\n\n this.opsCache?.addOps(ops);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspDocumentServiceFactory.d.ts","sourceRoot":"","sources":["../src/odspDocumentServiceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EACH,6BAA6B,EAC7B,YAAY,EACZ,eAAe,EACf,iBAAiB,EACpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"odspDocumentServiceFactory.d.ts","sourceRoot":"","sources":["../src/odspDocumentServiceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EACH,6BAA6B,EAC7B,YAAY,EACZ,eAAe,EACf,iBAAiB,EACpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAIlF;;;GAGG;AACH,qBAAa,0BAA2B,SAAQ,8BAA8B;gBAEtE,eAAe,EAAE,YAAY,CAAC,6BAA6B,CAAC,EAC5D,iBAAiB,EAAE,YAAY,CAAC,6BAA6B,CAAC,GAAG,SAAS,EAC1E,cAAc,CAAC,EAAE,eAAe,EAChC,UAAU,CAAC,EAAE,iBAAiB;CASrC;AAED,wBAAgB,qCAAqC,CAAC,aAAa,EAAE,UAAU,GAAG,MAAM,GAAG,uBAAuB,CAEjH"}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.createLocalOdspDocumentServiceFactory = exports.OdspDocumentServiceFactory = void 0;
|
|
8
8
|
const odspDocumentServiceFactoryCore_1 = require("./odspDocumentServiceFactoryCore");
|
|
9
|
-
const getSocketIo_1 = require("./getSocketIo");
|
|
10
9
|
// eslint-disable-next-line import/no-internal-modules
|
|
11
10
|
const localOdspDocumentServiceFactory_1 = require("./localOdspDriver/localOdspDocumentServiceFactory");
|
|
12
11
|
/**
|
|
@@ -15,7 +14,7 @@ const localOdspDocumentServiceFactory_1 = require("./localOdspDriver/localOdspDo
|
|
|
15
14
|
*/
|
|
16
15
|
class OdspDocumentServiceFactory extends odspDocumentServiceFactoryCore_1.OdspDocumentServiceFactoryCore {
|
|
17
16
|
constructor(getStorageToken, getWebsocketToken, persistedCache, hostPolicy) {
|
|
18
|
-
super(getStorageToken, getWebsocketToken,
|
|
17
|
+
super(getStorageToken, getWebsocketToken, persistedCache, hostPolicy);
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
exports.OdspDocumentServiceFactory = OdspDocumentServiceFactory;
|