@fluidframework/container-loader 2.0.0-internal.5.3.4 → 2.0.0-internal.5.4.2
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/CHANGELOG.md +4 -0
- package/README.md +6 -3
- package/dist/audience.d.ts +1 -0
- package/dist/audience.d.ts.map +1 -1
- package/dist/audience.js +3 -1
- package/dist/audience.js.map +1 -1
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js +6 -11
- package/dist/connectionManager.js.map +1 -1
- package/dist/container.d.ts +2 -3
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +58 -93
- package/dist/container.js.map +1 -1
- package/dist/debugLogger.d.ts +30 -0
- package/dist/debugLogger.d.ts.map +1 -0
- package/dist/debugLogger.js +96 -0
- package/dist/debugLogger.js.map +1 -0
- package/dist/deltaManager.d.ts +0 -1
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js +17 -9
- package/dist/deltaManager.js.map +1 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +16 -5
- package/dist/loader.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/protocol.d.ts +4 -2
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +23 -1
- package/dist/protocol.js.map +1 -1
- package/dist/quorum.d.ts +4 -1
- package/dist/quorum.d.ts.map +1 -1
- package/dist/quorum.js +1 -13
- package/dist/quorum.js.map +1 -1
- package/lib/audience.d.ts +1 -0
- package/lib/audience.d.ts.map +1 -1
- package/lib/audience.js +3 -1
- package/lib/audience.js.map +1 -1
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +7 -9
- package/lib/connectionManager.js.map +1 -1
- package/lib/container.d.ts +2 -3
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +61 -96
- package/lib/container.js.map +1 -1
- package/lib/debugLogger.d.ts +30 -0
- package/lib/debugLogger.d.ts.map +1 -0
- package/lib/debugLogger.js +92 -0
- package/lib/debugLogger.js.map +1 -0
- package/lib/deltaManager.d.ts +0 -1
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js +15 -4
- package/lib/deltaManager.js.map +1 -1
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js +16 -5
- package/lib/loader.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/protocol.d.ts +4 -2
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +23 -1
- package/lib/protocol.js.map +1 -1
- package/lib/quorum.d.ts +4 -1
- package/lib/quorum.d.ts.map +1 -1
- package/lib/quorum.js +0 -11
- package/lib/quorum.js.map +1 -1
- package/package.json +12 -12
- package/src/audience.ts +6 -0
- package/src/connectionManager.ts +7 -12
- package/src/container.ts +78 -116
- package/src/debugLogger.ts +113 -0
- package/src/deltaManager.ts +28 -4
- package/src/loader.ts +16 -7
- package/src/packageVersion.ts +1 -1
- package/src/protocol.ts +33 -1
- package/src/quorum.ts +0 -10
package/src/protocol.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { IAudienceOwner } from "@fluidframework/container-definitions";
|
|
7
|
+
import { canBeCoalescedByService } from "@fluidframework/driver-utils";
|
|
7
8
|
import {
|
|
8
9
|
IProtocolHandler as IBaseProtocolHandler,
|
|
9
10
|
IQuorumSnapshot,
|
|
@@ -11,8 +12,12 @@ import {
|
|
|
11
12
|
} from "@fluidframework/protocol-base";
|
|
12
13
|
import {
|
|
13
14
|
IDocumentAttributes,
|
|
15
|
+
IProcessMessageResult,
|
|
16
|
+
ISequencedClient,
|
|
17
|
+
ISequencedDocumentMessage,
|
|
14
18
|
ISignalClient,
|
|
15
19
|
ISignalMessage,
|
|
20
|
+
MessageType,
|
|
16
21
|
} from "@fluidframework/protocol-definitions";
|
|
17
22
|
|
|
18
23
|
// "term" was an experimental feature that is being removed. The only safe value to use is 1.
|
|
@@ -44,7 +49,8 @@ export class ProtocolHandler extends ProtocolOpHandler implements IProtocolHandl
|
|
|
44
49
|
attributes: IDocumentAttributes,
|
|
45
50
|
quorumSnapshot: IQuorumSnapshot,
|
|
46
51
|
sendProposal: (key: string, value: any) => number,
|
|
47
|
-
readonly audience: IAudienceOwner,
|
|
52
|
+
public readonly audience: IAudienceOwner,
|
|
53
|
+
private readonly shouldClientHaveLeft: (clientId: string) => boolean,
|
|
48
54
|
) {
|
|
49
55
|
super(
|
|
50
56
|
attributes.minimumSequenceNumber,
|
|
@@ -66,6 +72,32 @@ export class ProtocolHandler extends ProtocolOpHandler implements IProtocolHandl
|
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
74
|
|
|
75
|
+
public processMessage(
|
|
76
|
+
message: ISequencedDocumentMessage,
|
|
77
|
+
local: boolean,
|
|
78
|
+
): IProcessMessageResult {
|
|
79
|
+
const client: ISequencedClient | undefined = this.quorum.getMember(message.clientId);
|
|
80
|
+
|
|
81
|
+
// Check and report if we're getting messages from a clientId that we previously
|
|
82
|
+
// flagged as shouldHaveLeft, or from a client that's not in the quorum but should be
|
|
83
|
+
if (message.clientId != null) {
|
|
84
|
+
if (client === undefined && message.type !== MessageType.ClientJoin) {
|
|
85
|
+
// pre-0.58 error message: messageClientIdMissingFromQuorum
|
|
86
|
+
throw new Error("Remote message's clientId is missing from the quorum");
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Here checking canBeCoalescedByService is used as an approximation of "is benign to process despite being unexpected".
|
|
90
|
+
// It's still not good to see these messages from unexpected clientIds, but since they don't harm the integrity of the
|
|
91
|
+
// document we don't need to blow up aggressively.
|
|
92
|
+
if (this.shouldClientHaveLeft(message.clientId) && !canBeCoalescedByService(message)) {
|
|
93
|
+
// pre-0.58 error message: messageClientIdShouldHaveLeft
|
|
94
|
+
throw new Error("Remote message's clientId already should have left");
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return super.processMessage(message, local);
|
|
99
|
+
}
|
|
100
|
+
|
|
69
101
|
public processSignal(message: ISignalMessage) {
|
|
70
102
|
const innerContent = message.content as { content: any; type: string };
|
|
71
103
|
switch (innerContent.type) {
|
package/src/quorum.ts
CHANGED
|
@@ -2,19 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { assert } from "@fluidframework/common-utils";
|
|
6
5
|
import { IFluidCodeDetails } from "@fluidframework/core-interfaces";
|
|
7
6
|
import { ICommittedProposal } from "@fluidframework/protocol-definitions";
|
|
8
7
|
|
|
9
|
-
export function getCodeDetailsFromQuorumValues(
|
|
10
|
-
quorumValues: [string, ICommittedProposal][],
|
|
11
|
-
): IFluidCodeDetails {
|
|
12
|
-
const qValuesMap = new Map(quorumValues);
|
|
13
|
-
const proposal = qValuesMap.get("code");
|
|
14
|
-
assert(proposal !== undefined, 0x2dc /* "Cannot find code proposal" */);
|
|
15
|
-
return proposal?.value as IFluidCodeDetails;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
8
|
export function initQuorumValuesFromCodeDetails(
|
|
19
9
|
source: IFluidCodeDetails,
|
|
20
10
|
): [string, ICommittedProposal][] {
|