@fluidframework/container-loader 2.0.0-dev-rc.2.0.0.245554 → 2.0.0-dev-rc.3.0.0.250606
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/dist/attachment.d.ts +5 -8
- package/dist/attachment.d.ts.map +1 -1
- package/dist/attachment.js +2 -2
- package/dist/attachment.js.map +1 -1
- package/dist/audience.d.ts.map +1 -1
- package/dist/audience.js +2 -2
- package/dist/audience.js.map +1 -1
- package/dist/catchUpMonitor.d.ts +1 -1
- package/dist/catchUpMonitor.d.ts.map +1 -1
- package/dist/catchUpMonitor.js.map +1 -1
- package/dist/connectionManager.d.ts +3 -3
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js +1 -1
- package/dist/connectionManager.js.map +1 -1
- package/dist/connectionStateHandler.d.ts +3 -3
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts +4 -43
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +24 -37
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts +17 -7
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js +7 -2
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +2 -2
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/contracts.d.ts +3 -3
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/debugLogger.d.ts.map +1 -1
- package/dist/debugLogger.js.map +1 -1
- package/dist/deltaManager.d.ts +5 -5
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js +3 -3
- package/dist/deltaManager.js.map +1 -1
- package/dist/deltaQueue.d.ts +1 -1
- package/dist/deltaQueue.d.ts.map +1 -1
- package/dist/deltaQueue.js +1 -1
- package/dist/deltaQueue.js.map +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/loader.d.ts +3 -3
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +4 -4
- package/dist/loader.js.map +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
- package/dist/noopHeuristic.d.ts +1 -1
- package/dist/noopHeuristic.d.ts.map +1 -1
- package/dist/noopHeuristic.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/quorum.d.ts +1 -1
- package/dist/quorum.d.ts.map +1 -1
- package/dist/quorum.js +4 -0
- package/dist/quorum.js.map +1 -1
- package/dist/retriableDocumentStorageService.d.ts +1 -1
- package/dist/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/retriableDocumentStorageService.js +1 -1
- package/dist/retriableDocumentStorageService.js.map +1 -1
- package/dist/serializedStateManager.d.ts +57 -18
- package/dist/serializedStateManager.d.ts.map +1 -1
- package/dist/serializedStateManager.js +71 -80
- package/dist/serializedStateManager.js.map +1 -1
- package/dist/utils.d.ts +5 -6
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +27 -11
- package/dist/utils.js.map +1 -1
- package/lib/attachment.d.ts +5 -8
- 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.map +1 -1
- package/lib/catchUpMonitor.d.ts +1 -1
- package/lib/catchUpMonitor.d.ts.map +1 -1
- package/lib/catchUpMonitor.js.map +1 -1
- package/lib/connectionManager.d.ts +3 -3
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +3 -3
- package/lib/connectionManager.js.map +1 -1
- package/lib/connectionStateHandler.d.ts +3 -3
- package/lib/connectionStateHandler.d.ts.map +1 -1
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts +4 -43
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +27 -40
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts +17 -7
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js +7 -2
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +2 -2
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/contracts.d.ts +3 -3
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contracts.js.map +1 -1
- package/lib/debugLogger.d.ts.map +1 -1
- package/lib/debugLogger.js.map +1 -1
- package/lib/deltaManager.d.ts +5 -5
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js +3 -3
- package/lib/deltaManager.js.map +1 -1
- package/lib/deltaQueue.d.ts +1 -1
- package/lib/deltaQueue.d.ts.map +1 -1
- package/lib/deltaQueue.js +1 -1
- package/lib/deltaQueue.js.map +1 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/loader.d.ts +3 -3
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js +4 -4
- package/lib/loader.js.map +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
- package/lib/noopHeuristic.d.ts +1 -1
- package/lib/noopHeuristic.d.ts.map +1 -1
- package/lib/noopHeuristic.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/quorum.d.ts +1 -1
- package/lib/quorum.d.ts.map +1 -1
- package/lib/quorum.js +4 -0
- package/lib/quorum.js.map +1 -1
- package/lib/retriableDocumentStorageService.d.ts +1 -1
- package/lib/retriableDocumentStorageService.d.ts.map +1 -1
- package/lib/retriableDocumentStorageService.js +1 -1
- package/lib/retriableDocumentStorageService.js.map +1 -1
- package/lib/serializedStateManager.d.ts +57 -18
- package/lib/serializedStateManager.d.ts.map +1 -1
- package/lib/serializedStateManager.js +68 -79
- package/lib/serializedStateManager.js.map +1 -1
- package/lib/test/attachment.spec.js +2 -2
- package/lib/test/attachment.spec.js.map +1 -1
- package/lib/test/catchUpMonitor.spec.js.map +1 -1
- package/lib/test/connectionStateHandler.spec.js +1 -1
- package/lib/test/connectionStateHandler.spec.js.map +1 -1
- package/lib/test/container.spec.js +1 -1
- package/lib/test/container.spec.js.map +1 -1
- package/lib/test/deltaManager.spec.js +2 -2
- package/lib/test/deltaManager.spec.js.map +1 -1
- package/lib/test/loader.spec.js +4 -4
- package/lib/test/loader.spec.js.map +1 -1
- package/lib/test/serializedStateManager.spec.js +10 -7
- package/lib/test/serializedStateManager.spec.js.map +1 -1
- package/lib/test/snapshotConversionTest.spec.js +12 -12
- package/lib/test/snapshotConversionTest.spec.js.map +1 -1
- package/lib/test/utils.spec.js +66 -1
- package/lib/test/utils.spec.js.map +1 -1
- package/lib/utils.d.ts +5 -6
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +26 -11
- package/lib/utils.js.map +1 -1
- package/package.json +18 -15
- package/src/attachment.ts +7 -6
- package/src/audience.ts +2 -1
- package/src/catchUpMonitor.ts +1 -1
- package/src/connectionManager.ts +15 -15
- package/src/connectionStateHandler.ts +4 -4
- package/src/container.ts +68 -125
- package/src/containerContext.ts +16 -9
- package/src/containerStorageAdapter.ts +3 -3
- package/src/contracts.ts +4 -4
- package/src/debugLogger.ts +1 -1
- package/src/deltaManager.ts +24 -24
- package/src/deltaQueue.ts +1 -1
- package/src/error.ts +1 -1
- package/src/loader.ts +22 -21
- package/src/location-redirection-utilities/resolveWithLocationRedirection.ts +1 -1
- package/src/noopHeuristic.ts +2 -2
- package/src/packageVersion.ts +1 -1
- package/src/quorum.ts +2 -1
- package/src/retriableDocumentStorageService.ts +2 -2
- package/src/serializedStateManager.ts +133 -116
- package/src/utils.ts +47 -18
package/src/container.ts
CHANGED
|
@@ -3,16 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { v4 as uuid } from "uuid";
|
|
7
|
-
import { assert, unreachableCase, isPromiseLike } from "@fluidframework/core-utils";
|
|
8
6
|
import { TypedEventEmitter, performance } from "@fluid-internal/client-utils";
|
|
9
|
-
import {
|
|
10
|
-
IEvent,
|
|
11
|
-
ITelemetryBaseProperties,
|
|
12
|
-
FluidObject,
|
|
13
|
-
LogLevel,
|
|
14
|
-
IRequest,
|
|
15
|
-
} from "@fluidframework/core-interfaces";
|
|
16
7
|
import {
|
|
17
8
|
AttachState,
|
|
18
9
|
ContainerWarning,
|
|
@@ -25,16 +16,25 @@ import {
|
|
|
25
16
|
ICriticalContainerError,
|
|
26
17
|
IDeltaManager,
|
|
27
18
|
IFluidCodeDetails,
|
|
28
|
-
|
|
19
|
+
IFluidCodeDetailsComparer,
|
|
29
20
|
IFluidModuleWithDetails,
|
|
30
|
-
|
|
21
|
+
IGetPendingLocalStateProps,
|
|
22
|
+
IHostLoader,
|
|
31
23
|
IProvideFluidCodeDetailsComparer,
|
|
32
|
-
|
|
24
|
+
IProvideRuntimeFactory,
|
|
33
25
|
IRuntime,
|
|
34
26
|
ReadOnlyInfo,
|
|
35
27
|
isFluidCodeDetails,
|
|
36
|
-
IGetPendingLocalStateProps,
|
|
37
28
|
} from "@fluidframework/container-definitions";
|
|
29
|
+
import {
|
|
30
|
+
FluidObject,
|
|
31
|
+
IEvent,
|
|
32
|
+
IRequest,
|
|
33
|
+
type ISignalEnvelope,
|
|
34
|
+
ITelemetryBaseProperties,
|
|
35
|
+
LogLevel,
|
|
36
|
+
} from "@fluidframework/core-interfaces";
|
|
37
|
+
import { assert, isPromiseLike, unreachableCase } from "@fluidframework/core-utils";
|
|
38
38
|
import {
|
|
39
39
|
IDocumentService,
|
|
40
40
|
IDocumentServiceFactory,
|
|
@@ -45,12 +45,12 @@ import {
|
|
|
45
45
|
IUrlResolver,
|
|
46
46
|
} from "@fluidframework/driver-definitions";
|
|
47
47
|
import {
|
|
48
|
-
|
|
48
|
+
MessageType2,
|
|
49
49
|
OnlineStatus,
|
|
50
|
-
isOnline,
|
|
51
50
|
isCombinedAppAndProtocolSummary,
|
|
52
|
-
MessageType2,
|
|
53
51
|
isInstanceOfISnapshot,
|
|
52
|
+
isOnline,
|
|
53
|
+
readAndParse,
|
|
54
54
|
runWithRetry,
|
|
55
55
|
} from "@fluidframework/driver-utils";
|
|
56
56
|
import { IQuorumSnapshot } from "@fluidframework/protocol-base";
|
|
@@ -74,58 +74,64 @@ import {
|
|
|
74
74
|
SummaryType,
|
|
75
75
|
} from "@fluidframework/protocol-definitions";
|
|
76
76
|
import {
|
|
77
|
-
createChildLogger,
|
|
78
77
|
EventEmitterWithErrorHandling,
|
|
78
|
+
GenericError,
|
|
79
|
+
IFluidErrorBase,
|
|
80
|
+
ITelemetryLoggerExt,
|
|
81
|
+
MonitoringContext,
|
|
79
82
|
PerformanceEvent,
|
|
80
|
-
|
|
83
|
+
type TelemetryEventCategory,
|
|
84
|
+
UsageError,
|
|
81
85
|
connectedEventName,
|
|
82
|
-
|
|
83
|
-
MonitoringContext,
|
|
86
|
+
createChildLogger,
|
|
84
87
|
createChildMonitoringContext,
|
|
85
|
-
wrapError,
|
|
86
|
-
ITelemetryLoggerExt,
|
|
87
88
|
formatTick,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
type TelemetryEventCategory,
|
|
89
|
+
normalizeError,
|
|
90
|
+
raiseConnectedEvent,
|
|
91
|
+
wrapError,
|
|
92
92
|
} from "@fluidframework/telemetry-utils";
|
|
93
93
|
import structuredClone from "@ungap/structured-clone";
|
|
94
|
+
import { v4 as uuid } from "uuid";
|
|
95
|
+
import { AttachProcessProps, AttachmentData, runRetriableAttachProcess } from "./attachment.js";
|
|
94
96
|
import { Audience } from "./audience.js";
|
|
97
|
+
import { ConnectionManager } from "./connectionManager.js";
|
|
98
|
+
import { ConnectionState } from "./connectionState.js";
|
|
99
|
+
import { IConnectionStateHandler, createConnectionStateHandler } from "./connectionStateHandler.js";
|
|
95
100
|
import { ContainerContext } from "./containerContext.js";
|
|
101
|
+
import { ContainerStorageAdapter } from "./containerStorageAdapter.js";
|
|
96
102
|
import {
|
|
97
|
-
ReconnectMode,
|
|
98
|
-
IConnectionManagerFactoryArgs,
|
|
99
|
-
getPackageName,
|
|
100
103
|
IConnectionDetailsInternal,
|
|
104
|
+
IConnectionManagerFactoryArgs,
|
|
101
105
|
IConnectionStateChangeReason,
|
|
106
|
+
ReconnectMode,
|
|
107
|
+
getPackageName,
|
|
102
108
|
} from "./contracts.js";
|
|
103
109
|
import { DeltaManager, IConnectionArgs } from "./deltaManager.js";
|
|
104
110
|
import { IDetachedBlobStorage, ILoaderOptions, RelativeLoader } from "./loader.js";
|
|
111
|
+
import { NoopHeuristic } from "./noopHeuristic.js";
|
|
105
112
|
import { pkgVersion } from "./packageVersion.js";
|
|
106
|
-
import {
|
|
107
|
-
|
|
113
|
+
import {
|
|
114
|
+
IProtocolHandler,
|
|
115
|
+
ProtocolHandler,
|
|
116
|
+
ProtocolHandlerBuilder,
|
|
117
|
+
protocolHandlerShouldProcessSignal,
|
|
118
|
+
} from "./protocol.js";
|
|
119
|
+
import { initQuorumValuesFromCodeDetails } from "./quorum.js";
|
|
120
|
+
import {
|
|
121
|
+
type IPendingContainerState,
|
|
122
|
+
type IPendingDetachedContainerState,
|
|
123
|
+
SerializedStateManager,
|
|
124
|
+
} from "./serializedStateManager.js";
|
|
108
125
|
import {
|
|
109
126
|
ISnapshotTreeWithBlobContents,
|
|
110
127
|
combineAppAndProtocolSummary,
|
|
111
|
-
getProtocolSnapshotTree,
|
|
112
|
-
getSnapshotTreeAndBlobsFromSerializedContainer,
|
|
113
128
|
combineSnapshotTreeAndSnapshotBlobs,
|
|
114
129
|
getDetachedContainerStateFromSerializedContainer,
|
|
130
|
+
getDocumentAttributes,
|
|
131
|
+
getProtocolSnapshotTree,
|
|
132
|
+
getSnapshotTreeAndBlobsFromSerializedContainer,
|
|
115
133
|
runSingle,
|
|
116
134
|
} from "./utils.js";
|
|
117
|
-
import { initQuorumValuesFromCodeDetails } from "./quorum.js";
|
|
118
|
-
import { NoopHeuristic } from "./noopHeuristic.js";
|
|
119
|
-
import { ConnectionManager } from "./connectionManager.js";
|
|
120
|
-
import { ConnectionState } from "./connectionState.js";
|
|
121
|
-
import {
|
|
122
|
-
IProtocolHandler,
|
|
123
|
-
ProtocolHandler,
|
|
124
|
-
ProtocolHandlerBuilder,
|
|
125
|
-
protocolHandlerShouldProcessSignal,
|
|
126
|
-
} from "./protocol.js";
|
|
127
|
-
import { AttachProcessProps, AttachmentData, runRetriableAttachProcess } from "./attachment.js";
|
|
128
|
-
import { SerializedStateManager } from "./serializedStateManager.js";
|
|
129
135
|
|
|
130
136
|
const detachedContainerRefSeqNumber = 0;
|
|
131
137
|
|
|
@@ -335,46 +341,6 @@ export async function ReportIfTooLong(
|
|
|
335
341
|
}
|
|
336
342
|
}
|
|
337
343
|
|
|
338
|
-
/**
|
|
339
|
-
* State saved by a container at close time, to be used to load a new instance
|
|
340
|
-
* of the container to the same state
|
|
341
|
-
* @internal
|
|
342
|
-
*/
|
|
343
|
-
export interface IPendingContainerState {
|
|
344
|
-
attached: true;
|
|
345
|
-
pendingRuntimeState: unknown;
|
|
346
|
-
/**
|
|
347
|
-
* Snapshot from which container initially loaded.
|
|
348
|
-
*/
|
|
349
|
-
baseSnapshot: ISnapshotTree;
|
|
350
|
-
/**
|
|
351
|
-
* Serializable blobs from the base snapshot. Used to load offline since
|
|
352
|
-
* storage is not available.
|
|
353
|
-
*/
|
|
354
|
-
snapshotBlobs: ISerializableBlobContents;
|
|
355
|
-
/**
|
|
356
|
-
* All ops since base snapshot sequence number up to the latest op
|
|
357
|
-
* seen when the container was closed. Used to apply stashed (saved pending)
|
|
358
|
-
* ops at the same sequence number at which they were made.
|
|
359
|
-
*/
|
|
360
|
-
savedOps: ISequencedDocumentMessage[];
|
|
361
|
-
url: string;
|
|
362
|
-
clientId?: string;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* State saved by a container in detached state, to be used to load a new instance
|
|
367
|
-
* of the container to the same state (rehydrate)
|
|
368
|
-
* @internal
|
|
369
|
-
*/
|
|
370
|
-
export interface IPendingDetachedContainerState {
|
|
371
|
-
attached: false;
|
|
372
|
-
baseSnapshot: ISnapshotTree;
|
|
373
|
-
snapshotBlobs: ISerializableBlobContents;
|
|
374
|
-
hasAttachmentBlobs: boolean;
|
|
375
|
-
pendingRuntimeState?: unknown;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
344
|
const summarizerClientType = "summarizer";
|
|
379
345
|
|
|
380
346
|
interface IContainerLifecycleEvents extends IEvent {
|
|
@@ -1188,17 +1154,16 @@ export class Container
|
|
|
1188
1154
|
this.captureProtocolSummary(),
|
|
1189
1155
|
);
|
|
1190
1156
|
|
|
1191
|
-
const {
|
|
1157
|
+
const { baseSnapshot, snapshotBlobs } =
|
|
1192
1158
|
getSnapshotTreeAndBlobsFromSerializedContainer(combinedSummary);
|
|
1193
|
-
|
|
1194
1159
|
const pendingRuntimeState =
|
|
1195
1160
|
attachingData !== undefined ? this.runtime.getPendingLocalState() : undefined;
|
|
1196
1161
|
assert(!isPromiseLike(pendingRuntimeState), 0x8e3 /* should not be a promise */);
|
|
1197
1162
|
|
|
1198
1163
|
const detachedContainerState: IPendingDetachedContainerState = {
|
|
1199
1164
|
attached: false,
|
|
1200
|
-
baseSnapshot
|
|
1201
|
-
snapshotBlobs
|
|
1165
|
+
baseSnapshot,
|
|
1166
|
+
snapshotBlobs,
|
|
1202
1167
|
pendingRuntimeState,
|
|
1203
1168
|
hasAttachmentBlobs: !!this.detachedBlobStorage && this.detachedBlobStorage.size > 0,
|
|
1204
1169
|
};
|
|
@@ -1578,15 +1543,19 @@ export class Container
|
|
|
1578
1543
|
};
|
|
1579
1544
|
|
|
1580
1545
|
timings.phase2 = performance.now();
|
|
1546
|
+
|
|
1547
|
+
const supportGetSnapshotApi: boolean =
|
|
1548
|
+
this.mc.config.getBoolean("Fluid.Container.UseLoadingGroupIdForSnapshotFetch") ===
|
|
1549
|
+
true && this.service?.policies?.supportGetSnapshotApi === true;
|
|
1581
1550
|
// Fetch specified snapshot.
|
|
1582
|
-
const {
|
|
1551
|
+
const { baseSnapshot, version } = await this.serializedStateManager.fetchSnapshot(
|
|
1583
1552
|
specifiedVersion,
|
|
1584
|
-
|
|
1553
|
+
supportGetSnapshotApi,
|
|
1585
1554
|
);
|
|
1586
1555
|
this._loadedFromVersion = version;
|
|
1587
|
-
const attributes: IDocumentAttributes = await
|
|
1556
|
+
const attributes: IDocumentAttributes = await getDocumentAttributes(
|
|
1588
1557
|
this.storageAdapter,
|
|
1589
|
-
|
|
1558
|
+
baseSnapshot,
|
|
1590
1559
|
);
|
|
1591
1560
|
|
|
1592
1561
|
// If we saved ops, we will replay them and don't need DeltaManager to fetch them
|
|
@@ -1676,17 +1645,17 @@ export class Container
|
|
|
1676
1645
|
await this.initializeProtocolStateFromSnapshot(
|
|
1677
1646
|
attributes,
|
|
1678
1647
|
this.storageAdapter,
|
|
1679
|
-
|
|
1648
|
+
baseSnapshot,
|
|
1680
1649
|
);
|
|
1681
1650
|
|
|
1682
1651
|
timings.phase3 = performance.now();
|
|
1683
1652
|
const codeDetails = this.getCodeDetailsFromQuorum();
|
|
1684
1653
|
await this.instantiateRuntime(
|
|
1685
1654
|
codeDetails,
|
|
1686
|
-
|
|
1655
|
+
baseSnapshot,
|
|
1687
1656
|
// give runtime a dummy value so it knows we're loading from a stash blob
|
|
1688
1657
|
pendingLocalState ? pendingLocalState?.pendingRuntimeState ?? {} : undefined,
|
|
1689
|
-
isInstanceOfISnapshot(
|
|
1658
|
+
isInstanceOfISnapshot(baseSnapshot) ? baseSnapshot : undefined,
|
|
1690
1659
|
);
|
|
1691
1660
|
|
|
1692
1661
|
// replay saved ops
|
|
@@ -1814,7 +1783,7 @@ export class Container
|
|
|
1814
1783
|
const snapshotTreeWithBlobContents: ISnapshotTreeWithBlobContents =
|
|
1815
1784
|
combineSnapshotTreeAndSnapshotBlobs(baseSnapshot, snapshotBlobs);
|
|
1816
1785
|
this.storageAdapter.loadSnapshotFromSnapshotBlobs(snapshotBlobs);
|
|
1817
|
-
const attributes = await
|
|
1786
|
+
const attributes = await getDocumentAttributes(
|
|
1818
1787
|
this.storageAdapter,
|
|
1819
1788
|
snapshotTreeWithBlobContents,
|
|
1820
1789
|
);
|
|
@@ -1846,28 +1815,6 @@ export class Container
|
|
|
1846
1815
|
this.setLoaded();
|
|
1847
1816
|
}
|
|
1848
1817
|
|
|
1849
|
-
private async getDocumentAttributes(
|
|
1850
|
-
storage: IDocumentStorageService,
|
|
1851
|
-
tree: ISnapshotTree | undefined,
|
|
1852
|
-
): Promise<IDocumentAttributes> {
|
|
1853
|
-
if (tree === undefined) {
|
|
1854
|
-
return {
|
|
1855
|
-
minimumSequenceNumber: 0,
|
|
1856
|
-
sequenceNumber: 0,
|
|
1857
|
-
};
|
|
1858
|
-
}
|
|
1859
|
-
|
|
1860
|
-
// Backward compatibility: old docs would have ".attributes" instead of "attributes"
|
|
1861
|
-
const attributesHash =
|
|
1862
|
-
".protocol" in tree.trees
|
|
1863
|
-
? tree.trees[".protocol"].blobs.attributes
|
|
1864
|
-
: tree.blobs[".attributes"];
|
|
1865
|
-
|
|
1866
|
-
const attributes = await readAndParse<IDocumentAttributes>(storage, attributesHash);
|
|
1867
|
-
|
|
1868
|
-
return attributes;
|
|
1869
|
-
}
|
|
1870
|
-
|
|
1871
1818
|
private async initializeProtocolStateFromSnapshot(
|
|
1872
1819
|
attributes: IDocumentAttributes,
|
|
1873
1820
|
storage: IDocumentStorageService,
|
|
@@ -2341,7 +2288,8 @@ export class Container
|
|
|
2341
2288
|
this.emit("op", message);
|
|
2342
2289
|
}
|
|
2343
2290
|
|
|
2344
|
-
|
|
2291
|
+
// unknown should be removed once `@alpha` tag is removed from IContainerContext
|
|
2292
|
+
private submitSignal(content: unknown | ISignalEnvelope, targetClientId?: string) {
|
|
2345
2293
|
this._deltaManager.submitSignal(JSON.stringify(content), targetClientId);
|
|
2346
2294
|
}
|
|
2347
2295
|
|
|
@@ -2389,10 +2337,6 @@ export class Container
|
|
|
2389
2337
|
throw new Error(packageNotFactoryError);
|
|
2390
2338
|
}
|
|
2391
2339
|
|
|
2392
|
-
const getSpecifiedCodeDetails = () =>
|
|
2393
|
-
(this.protocolHandler.quorum.get("code") ??
|
|
2394
|
-
this.protocolHandler.quorum.get("code2")) as IFluidCodeDetails | undefined;
|
|
2395
|
-
|
|
2396
2340
|
const existing = snapshotTree !== undefined;
|
|
2397
2341
|
|
|
2398
2342
|
const context = new ContainerContext(
|
|
@@ -2420,7 +2364,6 @@ export class Container
|
|
|
2420
2364
|
() => this.clientId,
|
|
2421
2365
|
() => this.attachState,
|
|
2422
2366
|
() => this.connected,
|
|
2423
|
-
getSpecifiedCodeDetails,
|
|
2424
2367
|
this._deltaManager.clientDetails,
|
|
2425
2368
|
existing,
|
|
2426
2369
|
this.subLogger,
|
package/src/containerContext.ts
CHANGED
|
@@ -3,19 +3,17 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
7
6
|
import {
|
|
7
|
+
AttachState,
|
|
8
8
|
IAudience,
|
|
9
|
+
IBatchMessage,
|
|
9
10
|
IContainerContext,
|
|
11
|
+
ICriticalContainerError,
|
|
10
12
|
IDeltaManager,
|
|
11
13
|
ILoader,
|
|
12
|
-
ICriticalContainerError,
|
|
13
|
-
AttachState,
|
|
14
14
|
ILoaderOptions,
|
|
15
|
-
IFluidCodeDetails,
|
|
16
|
-
IBatchMessage,
|
|
17
15
|
} from "@fluidframework/container-definitions";
|
|
18
|
-
import { FluidObject } from "@fluidframework/core-interfaces";
|
|
16
|
+
import { type FluidObject, type ISignalEnvelope } from "@fluidframework/core-interfaces";
|
|
19
17
|
import { IDocumentStorageService, ISnapshot } from "@fluidframework/driver-definitions";
|
|
20
18
|
import {
|
|
21
19
|
IClientDetails,
|
|
@@ -23,10 +21,11 @@ import {
|
|
|
23
21
|
IQuorumClients,
|
|
24
22
|
ISequencedDocumentMessage,
|
|
25
23
|
ISnapshotTree,
|
|
24
|
+
ISummaryContent,
|
|
26
25
|
IVersion,
|
|
27
26
|
MessageType,
|
|
28
|
-
ISummaryContent,
|
|
29
27
|
} from "@fluidframework/protocol-definitions";
|
|
28
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
31
|
* {@inheritDoc @fluidframework/container-definitions#IContainerContext}
|
|
@@ -85,7 +84,16 @@ export class ContainerContext implements IContainerContext {
|
|
|
85
84
|
batch: IBatchMessage[],
|
|
86
85
|
referenceSequenceNumber?: number,
|
|
87
86
|
) => number,
|
|
88
|
-
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* `unknown` should be removed once `@alpha` tag is removed from IContainerContext
|
|
90
|
+
* @see {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}
|
|
91
|
+
* Any changes to submitSignalFn `content` should be checked internally by temporarily changing IContainerContext and removing all `unknown`s
|
|
92
|
+
*/
|
|
93
|
+
public readonly submitSignalFn: (
|
|
94
|
+
content: unknown | ISignalEnvelope,
|
|
95
|
+
targetClientId?: string,
|
|
96
|
+
) => void,
|
|
89
97
|
public readonly disposeFn: (error?: ICriticalContainerError) => void,
|
|
90
98
|
public readonly closeFn: (error?: ICriticalContainerError) => void,
|
|
91
99
|
public readonly updateDirtyContainerState: (dirty: boolean) => void,
|
|
@@ -94,7 +102,6 @@ export class ContainerContext implements IContainerContext {
|
|
|
94
102
|
private readonly _getClientId: () => string | undefined,
|
|
95
103
|
private readonly _getAttachState: () => AttachState,
|
|
96
104
|
private readonly _getConnected: () => boolean,
|
|
97
|
-
public readonly getSpecifiedCodeDetails: () => IFluidCodeDetails | undefined,
|
|
98
105
|
public readonly clientDetails: IClientDetails,
|
|
99
106
|
public readonly existing: boolean,
|
|
100
107
|
public readonly taggedLogger: ITelemetryLoggerExt,
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IDisposable } from "@fluidframework/core-interfaces";
|
|
7
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
8
6
|
import { bufferToString, stringToBuffer } from "@fluid-internal/client-utils";
|
|
9
|
-
import { assert } from "@fluidframework/core-utils";
|
|
10
7
|
import { ISnapshotTreeWithBlobContents } from "@fluidframework/container-definitions";
|
|
8
|
+
import { IDisposable } from "@fluidframework/core-interfaces";
|
|
9
|
+
import { assert } from "@fluidframework/core-utils";
|
|
11
10
|
import {
|
|
12
11
|
FetchSource,
|
|
13
12
|
IDocumentService,
|
|
@@ -25,6 +24,7 @@ import {
|
|
|
25
24
|
ISummaryTree,
|
|
26
25
|
IVersion,
|
|
27
26
|
} from "@fluidframework/protocol-definitions";
|
|
27
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
28
28
|
import { IDetachedBlobStorage } from "./loader.js";
|
|
29
29
|
import { ProtocolTreeStorageService } from "./protocolTreeDocumentStorageService.js";
|
|
30
30
|
import { RetriableDocumentStorageService } from "./retriableDocumentStorageService.js";
|
package/src/contracts.ts
CHANGED
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IErrorBase, ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
7
6
|
import {
|
|
8
7
|
IConnectionDetails,
|
|
9
8
|
ICriticalContainerError,
|
|
10
9
|
IDeltaQueue,
|
|
11
10
|
IFluidCodeDetails,
|
|
12
|
-
isFluidPackage,
|
|
13
11
|
ReadOnlyInfo,
|
|
12
|
+
isFluidPackage,
|
|
14
13
|
} from "@fluidframework/container-definitions";
|
|
14
|
+
import { IErrorBase, ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
15
|
+
import { IContainerPackageInfo } from "@fluidframework/driver-definitions";
|
|
15
16
|
import {
|
|
16
17
|
ConnectionMode,
|
|
17
18
|
IClientConfiguration,
|
|
@@ -21,7 +22,6 @@ import {
|
|
|
21
22
|
ISignalClient,
|
|
22
23
|
ISignalMessage,
|
|
23
24
|
} from "@fluidframework/protocol-definitions";
|
|
24
|
-
import { IContainerPackageInfo } from "@fluidframework/driver-definitions";
|
|
25
25
|
|
|
26
26
|
export enum ReconnectMode {
|
|
27
27
|
Never = "Never",
|
|
@@ -100,7 +100,7 @@ export interface IConnectionManager {
|
|
|
100
100
|
* Submits signal to relay service.
|
|
101
101
|
* Called only when active connection is present.
|
|
102
102
|
*/
|
|
103
|
-
submitSignal(content:
|
|
103
|
+
submitSignal: (content: string, targetClientId?: string) => void;
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
106
|
* Submits messages to relay service.
|
package/src/debugLogger.ts
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { performance } from "@fluid-internal/client-utils";
|
|
6
7
|
import {
|
|
7
8
|
ITelemetryBaseEvent,
|
|
8
9
|
ITelemetryBaseLogger,
|
|
9
10
|
ITelemetryBaseProperties,
|
|
10
11
|
} from "@fluidframework/core-interfaces";
|
|
11
|
-
import { performance } from "@fluid-internal/client-utils";
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
14
|
ITelemetryLoggerExt,
|
package/src/deltaManager.ts
CHANGED
|
@@ -3,46 +3,46 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
IThrottlingWarning,
|
|
9
|
-
IEventProvider,
|
|
10
|
-
ITelemetryBaseProperties,
|
|
11
|
-
type ITelemetryBaseEvent,
|
|
12
|
-
} from "@fluidframework/core-interfaces";
|
|
6
|
+
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
13
7
|
import {
|
|
14
8
|
ICriticalContainerError,
|
|
15
9
|
IDeltaManager,
|
|
16
10
|
IDeltaManagerEvents,
|
|
17
11
|
IDeltaQueue,
|
|
18
12
|
} from "@fluidframework/container-definitions";
|
|
19
|
-
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
20
|
-
import { assert } from "@fluidframework/core-utils";
|
|
21
13
|
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
DataCorruptionError,
|
|
29
|
-
UsageError,
|
|
30
|
-
type ITelemetryGenericEventExt,
|
|
31
|
-
type ITelemetryErrorEventExt,
|
|
32
|
-
} from "@fluidframework/telemetry-utils";
|
|
14
|
+
IEventProvider,
|
|
15
|
+
type ITelemetryBaseEvent,
|
|
16
|
+
ITelemetryBaseProperties,
|
|
17
|
+
IThrottlingWarning,
|
|
18
|
+
} from "@fluidframework/core-interfaces";
|
|
19
|
+
import { assert } from "@fluidframework/core-utils";
|
|
33
20
|
import {
|
|
21
|
+
DriverErrorTypes,
|
|
34
22
|
IDocumentDeltaStorageService,
|
|
35
23
|
IDocumentService,
|
|
36
|
-
DriverErrorTypes,
|
|
37
24
|
} from "@fluidframework/driver-definitions";
|
|
25
|
+
import { MessageType2, NonRetryableError, isRuntimeMessage } from "@fluidframework/driver-utils";
|
|
38
26
|
import {
|
|
27
|
+
ConnectionMode,
|
|
39
28
|
IDocumentMessage,
|
|
40
29
|
ISequencedDocumentMessage,
|
|
41
30
|
ISignalMessage,
|
|
42
31
|
MessageType,
|
|
43
|
-
ConnectionMode,
|
|
44
32
|
} from "@fluidframework/protocol-definitions";
|
|
45
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
DataCorruptionError,
|
|
35
|
+
DataProcessingError,
|
|
36
|
+
type ITelemetryErrorEventExt,
|
|
37
|
+
type ITelemetryGenericEventExt,
|
|
38
|
+
ITelemetryLoggerExt,
|
|
39
|
+
UsageError,
|
|
40
|
+
extractSafePropertiesFromMessage,
|
|
41
|
+
isFluidError,
|
|
42
|
+
normalizeError,
|
|
43
|
+
safeRaiseEvent,
|
|
44
|
+
} from "@fluidframework/telemetry-utils";
|
|
45
|
+
import { v4 as uuid } from "uuid";
|
|
46
46
|
|
|
47
47
|
import {
|
|
48
48
|
IConnectionDetailsInternal,
|
|
@@ -325,7 +325,7 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
325
325
|
return message.clientSequenceNumber;
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
public submitSignal(content:
|
|
328
|
+
public submitSignal(content: string, targetClientId?: string) {
|
|
329
329
|
return this.connectionManager.submitSignal(content, targetClientId);
|
|
330
330
|
}
|
|
331
331
|
|
package/src/deltaQueue.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { TypedEventEmitter, performance } from "@fluid-internal/client-utils";
|
|
6
7
|
import { IDeltaQueue, IDeltaQueueEvents } from "@fluidframework/container-definitions";
|
|
7
8
|
import { assert } from "@fluidframework/core-utils";
|
|
8
|
-
import { performance, TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
9
9
|
import Deque from "double-ended-queue";
|
|
10
10
|
|
|
11
11
|
export interface IDeltaQueueWriter<T> {
|
package/src/error.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ITelemetryBaseProperties, IThrottlingWarning } from "@fluidframework/core-interfaces";
|
|
7
6
|
import { ContainerErrorTypes } from "@fluidframework/container-definitions";
|
|
7
|
+
import { ITelemetryBaseProperties, IThrottlingWarning } from "@fluidframework/core-interfaces";
|
|
8
8
|
import {
|
|
9
9
|
IFluidErrorBase,
|
|
10
10
|
ITelemetryLoggerExt,
|
package/src/loader.ts
CHANGED
|
@@ -3,32 +3,22 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { v4 as uuid } from "uuid";
|
|
7
|
-
import {
|
|
8
|
-
ITelemetryLoggerExt,
|
|
9
|
-
mixinMonitoringContext,
|
|
10
|
-
MonitoringContext,
|
|
11
|
-
PerformanceEvent,
|
|
12
|
-
sessionStorageConfigProvider,
|
|
13
|
-
createChildMonitoringContext,
|
|
14
|
-
UsageError,
|
|
15
|
-
} from "@fluidframework/telemetry-utils";
|
|
16
|
-
import {
|
|
17
|
-
ITelemetryBaseLogger,
|
|
18
|
-
FluidObject,
|
|
19
|
-
IRequest,
|
|
20
|
-
IConfigProviderBase,
|
|
21
|
-
} from "@fluidframework/core-interfaces";
|
|
22
6
|
import {
|
|
23
7
|
IContainer,
|
|
8
|
+
IFluidCodeDetails,
|
|
24
9
|
IFluidModule,
|
|
25
10
|
IHostLoader,
|
|
26
11
|
ILoader,
|
|
27
12
|
ILoaderOptions as ILoaderOptions1,
|
|
28
|
-
LoaderHeader,
|
|
29
13
|
IProvideFluidCodeDetailsComparer,
|
|
30
|
-
|
|
14
|
+
LoaderHeader,
|
|
31
15
|
} from "@fluidframework/container-definitions";
|
|
16
|
+
import {
|
|
17
|
+
FluidObject,
|
|
18
|
+
IConfigProviderBase,
|
|
19
|
+
IRequest,
|
|
20
|
+
ITelemetryBaseLogger,
|
|
21
|
+
} from "@fluidframework/core-interfaces";
|
|
32
22
|
import {
|
|
33
23
|
IDocumentServiceFactory,
|
|
34
24
|
IDocumentStorageService,
|
|
@@ -36,11 +26,22 @@ import {
|
|
|
36
26
|
IUrlResolver,
|
|
37
27
|
} from "@fluidframework/driver-definitions";
|
|
38
28
|
import { IClientDetails } from "@fluidframework/protocol-definitions";
|
|
39
|
-
import {
|
|
40
|
-
|
|
29
|
+
import {
|
|
30
|
+
ITelemetryLoggerExt,
|
|
31
|
+
MonitoringContext,
|
|
32
|
+
PerformanceEvent,
|
|
33
|
+
UsageError,
|
|
34
|
+
createChildMonitoringContext,
|
|
35
|
+
mixinMonitoringContext,
|
|
36
|
+
sessionStorageConfigProvider,
|
|
37
|
+
} from "@fluidframework/telemetry-utils";
|
|
38
|
+
import { v4 as uuid } from "uuid";
|
|
39
|
+
import { Container } from "./container.js";
|
|
40
|
+
import { DebugLogger } from "./debugLogger.js";
|
|
41
41
|
import { pkgVersion } from "./packageVersion.js";
|
|
42
42
|
import { ProtocolHandlerBuilder } from "./protocol.js";
|
|
43
|
-
import {
|
|
43
|
+
import type { IPendingContainerState } from "./serializedStateManager.js";
|
|
44
|
+
import { tryParseCompatibleResolvedUrl } from "./utils.js";
|
|
44
45
|
|
|
45
46
|
function ensureResolvedUrlDefined(
|
|
46
47
|
resolved: IResolvedUrl | undefined,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { IRequest, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
7
|
import {
|
|
8
8
|
DriverErrorTypes,
|
|
9
9
|
ILocationRedirectionError,
|
package/src/noopHeuristic.ts
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
|
+
import { IEvent } from "@fluidframework/core-interfaces";
|
|
7
8
|
import { assert, Timer } from "@fluidframework/core-utils";
|
|
8
|
-
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
9
9
|
import { isRuntimeMessage } from "@fluidframework/driver-utils";
|
|
10
|
-
import {
|
|
10
|
+
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
11
11
|
|
|
12
12
|
const defaultNoopTimeFrequency = 2000;
|
|
13
13
|
const defaultNoopCountFrequency = 50;
|
package/src/packageVersion.ts
CHANGED
package/src/quorum.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
import { IFluidCodeDetails } from "@fluidframework/container-definitions";
|
|
6
7
|
import { ICommittedProposal } from "@fluidframework/protocol-definitions";
|
|
7
8
|
|
|
8
9
|
export function initQuorumValuesFromCodeDetails(
|