@fluidframework/protocol-base
Advanced tools
Comparing version 0.1037.1000-79728 to 0.1037.1000-80725
@@ -8,3 +8,3 @@ /*! | ||
export declare const pkgName = "@fluidframework/protocol-base"; | ||
export declare const pkgVersion = "0.1037.1000-79728"; | ||
export declare const pkgVersion = "0.1037.1000-80725"; | ||
//# sourceMappingURL=packageVersion.d.ts.map |
@@ -11,3 +11,3 @@ "use strict"; | ||
exports.pkgName = "@fluidframework/protocol-base"; | ||
exports.pkgVersion = "0.1037.1000-79728"; | ||
exports.pkgVersion = "0.1037.1000-80725"; | ||
//# sourceMappingURL=packageVersion.js.map |
@@ -5,3 +5,3 @@ /*! | ||
*/ | ||
import { IDocumentAttributes, ICommittedProposal, IProcessMessageResult, IQuorum, ISequencedClient, ISequencedDocumentMessage, ISequencedProposal } from "@fluidframework/protocol-definitions"; | ||
import { IDocumentAttributes, ICommittedProposal, IProcessMessageResult, IQuorum, ISequencedClient, ISequencedDocumentMessage, ISequencedProposal, ISignalMessage } from "@fluidframework/protocol-definitions"; | ||
import { IQuorumSnapshot, Quorum } from "./quorum"; | ||
@@ -29,2 +29,3 @@ export interface IScribeProtocolState { | ||
processMessage(message: ISequencedDocumentMessage, local: boolean): IProcessMessageResult; | ||
processSignal(message: ISignalMessage): any; | ||
getProtocolState(): IScribeProtocolState; | ||
@@ -38,3 +39,3 @@ } | ||
sequenceNumber: number; | ||
readonly _quorum: Quorum; | ||
private readonly _quorum; | ||
get quorum(): Quorum; | ||
@@ -47,2 +48,3 @@ readonly term: number; | ||
close(): void; | ||
processSignal(_message: ISignalMessage): void; | ||
processMessage(message: ISequencedDocumentMessage, local: boolean): IProcessMessageResult; | ||
@@ -54,5 +56,2 @@ /** | ||
} | ||
export declare class ProtocolOpHandlerWithClientValidation extends ProtocolOpHandler { | ||
processMessage(message: ISequencedDocumentMessage, local: boolean): IProcessMessageResult; | ||
} | ||
//# sourceMappingURL=protocol.d.ts.map |
@@ -7,3 +7,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ProtocolOpHandlerWithClientValidation = exports.ProtocolOpHandler = exports.isSystemMessage = void 0; | ||
exports.ProtocolOpHandler = exports.isSystemMessage = void 0; | ||
const protocol_definitions_1 = require("@fluidframework/protocol-definitions"); | ||
@@ -57,2 +57,3 @@ const quorum_1 = require("./quorum"); | ||
} | ||
processSignal(_message) { } | ||
processMessage(message, local) { | ||
@@ -108,21 +109,2 @@ // verify it's moving sequentially | ||
exports.ProtocolOpHandler = ProtocolOpHandler; | ||
class ProtocolOpHandlerWithClientValidation extends ProtocolOpHandler { | ||
processMessage(message, local) { | ||
const client = this._quorum.getMember(message.clientId); | ||
// Check and report if we're getting messages from a clientId that we previously | ||
// flagged as shouldHaveLeft, or from a client that's not in the quorum but should be | ||
if (message.clientId != null) { | ||
if (client === undefined && message.type !== protocol_definitions_1.MessageType.ClientJoin) { | ||
// pre-0.58 error message: messageClientIdMissingFromQuorum | ||
throw new Error("Remote message's clientId is missing from the quorum"); | ||
} | ||
if ((client === null || client === void 0 ? void 0 : client.shouldHaveLeft) === true && message.type !== protocol_definitions_1.MessageType.NoOp) { | ||
// pre-0.58 error message: messageClientIdShouldHaveLeft | ||
throw new Error("Remote message's clientId already should have left"); | ||
} | ||
} | ||
return super.processMessage(message, local); | ||
} | ||
} | ||
exports.ProtocolOpHandlerWithClientValidation = ProtocolOpHandlerWithClientValidation; | ||
//# sourceMappingURL=protocol.js.map |
@@ -8,3 +8,3 @@ /*! | ||
export declare const pkgName = "@fluidframework/protocol-base"; | ||
export declare const pkgVersion = "0.1037.1000-79728"; | ||
export declare const pkgVersion = "0.1037.1000-80725"; | ||
//# sourceMappingURL=packageVersion.d.ts.map |
@@ -8,3 +8,3 @@ /*! | ||
export const pkgName = "@fluidframework/protocol-base"; | ||
export const pkgVersion = "0.1037.1000-79728"; | ||
export const pkgVersion = "0.1037.1000-80725"; | ||
//# sourceMappingURL=packageVersion.js.map |
@@ -5,3 +5,3 @@ /*! | ||
*/ | ||
import { IDocumentAttributes, ICommittedProposal, IProcessMessageResult, IQuorum, ISequencedClient, ISequencedDocumentMessage, ISequencedProposal } from "@fluidframework/protocol-definitions"; | ||
import { IDocumentAttributes, ICommittedProposal, IProcessMessageResult, IQuorum, ISequencedClient, ISequencedDocumentMessage, ISequencedProposal, ISignalMessage } from "@fluidframework/protocol-definitions"; | ||
import { IQuorumSnapshot, Quorum } from "./quorum"; | ||
@@ -29,2 +29,3 @@ export interface IScribeProtocolState { | ||
processMessage(message: ISequencedDocumentMessage, local: boolean): IProcessMessageResult; | ||
processSignal(message: ISignalMessage): any; | ||
getProtocolState(): IScribeProtocolState; | ||
@@ -38,3 +39,3 @@ } | ||
sequenceNumber: number; | ||
readonly _quorum: Quorum; | ||
private readonly _quorum; | ||
get quorum(): Quorum; | ||
@@ -47,2 +48,3 @@ readonly term: number; | ||
close(): void; | ||
processSignal(_message: ISignalMessage): void; | ||
processMessage(message: ISequencedDocumentMessage, local: boolean): IProcessMessageResult; | ||
@@ -54,5 +56,2 @@ /** | ||
} | ||
export declare class ProtocolOpHandlerWithClientValidation extends ProtocolOpHandler { | ||
processMessage(message: ISequencedDocumentMessage, local: boolean): IProcessMessageResult; | ||
} | ||
//# sourceMappingURL=protocol.d.ts.map |
@@ -52,2 +52,3 @@ /*! | ||
} | ||
processSignal(_message) { } | ||
processMessage(message, local) { | ||
@@ -102,20 +103,2 @@ // verify it's moving sequentially | ||
} | ||
export class ProtocolOpHandlerWithClientValidation extends ProtocolOpHandler { | ||
processMessage(message, local) { | ||
const client = this._quorum.getMember(message.clientId); | ||
// Check and report if we're getting messages from a clientId that we previously | ||
// flagged as shouldHaveLeft, or from a client that's not in the quorum but should be | ||
if (message.clientId != null) { | ||
if (client === undefined && message.type !== MessageType.ClientJoin) { | ||
// pre-0.58 error message: messageClientIdMissingFromQuorum | ||
throw new Error("Remote message's clientId is missing from the quorum"); | ||
} | ||
if ((client === null || client === void 0 ? void 0 : client.shouldHaveLeft) === true && message.type !== MessageType.NoOp) { | ||
// pre-0.58 error message: messageClientIdShouldHaveLeft | ||
throw new Error("Remote message's clientId already should have left"); | ||
} | ||
} | ||
return super.processMessage(message, local); | ||
} | ||
} | ||
//# sourceMappingURL=protocol.js.map |
{ | ||
"name": "@fluidframework/protocol-base", | ||
"version": "0.1037.1000-79728", | ||
"version": "0.1037.1000-80725", | ||
"description": "Fluid protocol base", | ||
@@ -62,3 +62,3 @@ "homepage": "https://fluidframework.com", | ||
"@fluidframework/common-utils": "^0.33.1000-74526", | ||
"@fluidframework/gitresources": "0.1037.1000-79728", | ||
"@fluidframework/gitresources": "0.1037.1000-80725", | ||
"@fluidframework/protocol-definitions": "^0.1029.1000-0", | ||
@@ -65,0 +65,0 @@ "lodash": "^4.17.21" |
@@ -9,2 +9,2 @@ /*! | ||
export const pkgName = "@fluidframework/protocol-base"; | ||
export const pkgVersion = "0.1037.1000-79728"; | ||
export const pkgVersion = "0.1037.1000-80725"; |
@@ -18,2 +18,3 @@ /*! | ||
MessageType, | ||
ISignalMessage, | ||
} from "@fluidframework/protocol-definitions"; | ||
@@ -63,2 +64,3 @@ import { IQuorumSnapshot, Quorum } from "./quorum"; | ||
processMessage(message: ISequencedDocumentMessage, local: boolean): IProcessMessageResult; | ||
processSignal(message: ISignalMessage); | ||
getProtocolState(): IScribeProtocolState; | ||
@@ -71,3 +73,3 @@ } | ||
export class ProtocolOpHandler implements IProtocolHandler { | ||
public readonly _quorum: Quorum; | ||
private readonly _quorum: Quorum; | ||
public get quorum(): Quorum { | ||
@@ -117,2 +119,4 @@ return this._quorum; | ||
public processSignal(_message: ISignalMessage) {} | ||
public processMessage(message: ISequencedDocumentMessage, local: boolean): IProcessMessageResult { | ||
@@ -188,23 +192,1 @@ // verify it's moving sequentially | ||
} | ||
export class ProtocolOpHandlerWithClientValidation extends ProtocolOpHandler { | ||
public processMessage(message: ISequencedDocumentMessage, local: boolean): IProcessMessageResult { | ||
const client: ILocalSequencedClient | undefined = this._quorum.getMember(message.clientId); | ||
// Check and report if we're getting messages from a clientId that we previously | ||
// flagged as shouldHaveLeft, or from a client that's not in the quorum but should be | ||
if (message.clientId != null) { | ||
if (client === undefined && message.type !== MessageType.ClientJoin) { | ||
// pre-0.58 error message: messageClientIdMissingFromQuorum | ||
throw new Error("Remote message's clientId is missing from the quorum"); | ||
} | ||
if (client?.shouldHaveLeft === true && message.type !== MessageType.NoOp) { | ||
// pre-0.58 error message: messageClientIdShouldHaveLeft | ||
throw new Error("Remote message's clientId already should have left"); | ||
} | ||
} | ||
return super.processMessage(message, local); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
253257
3214
+ Added@fluidframework/gitresources@0.1037.1000-80725(transitive)
- Removed@fluidframework/gitresources@0.1037.1000-79728(transitive)