Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated inbound and outbound queues on IDeltaManager #22282

Merged
merged 20 commits into from
Nov 7, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,13 @@ export interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>
readonly active: boolean;
readonly clientDetails: IClientDetails;
readonly hasCheckpointSequenceNumber: boolean;
// @deprecated
readonly inbound: IDeltaQueue<T>;
jatgarg marked this conversation as resolved.
Show resolved Hide resolved
readonly inboundSignal: IDeltaQueue<ISignalMessage>;
jatgarg marked this conversation as resolved.
Show resolved Hide resolved
readonly initialSequenceNumber: number;
readonly lastKnownSeqNumber: number;
readonly lastMessage: ISequencedDocumentMessage | undefined;
readonly lastSequenceNumber: number;
readonly maxMessageSize: number;
readonly minimumSequenceNumber: number;
// @deprecated
readonly outbound: IDeltaQueue<U[]>;
// (undocumented)
readonly readOnlyInfo: ReadOnlyInfo;
readonly serviceConfiguration: IClientConfiguration | undefined;
Expand All @@ -235,6 +231,12 @@ export interface IDeltaManagerEvents extends IEvent {
}) => void): any;
}

// @alpha @sealed
export interface IDeltaManagerInternal<T = ISequencedDocumentMessage, U = IDocumentMessage> extends IDeltaManager<T, U> {
readonly inbound: IDeltaQueue<T>;
readonly outbound: IDeltaQueue<U[]>;
}

// @alpha @sealed
export interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable {
idle: boolean;
Expand Down
12 changes: 11 additions & 1 deletion packages/common/container-definitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {}
"broken": {
"Interface_IContainer": {
"backCompat": false
},
"Interface_IContainerContext": {
"backCompat": false
},
"Interface_IDeltaManager": {
"backCompat": false
}
}
}
}
33 changes: 19 additions & 14 deletions packages/common/container-definitions/src/deltas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,6 @@ export interface IDeltaManagerEvents extends IEvent {
export interface IDeltaManager<T, U>
extends IEventProvider<IDeltaManagerEvents>,
IDeltaSender {
/**
* The queue of inbound delta messages
* @deprecated Do not use, for internal use only. There are a lot of complications in core pieces of the runtime
* may break if this is used directly. For example summarization and op processing.
*/
readonly inbound: IDeltaQueue<T>;
jatgarg marked this conversation as resolved.
Show resolved Hide resolved

/**
* The queue of outbound delta messages
* @deprecated Do not use, for internal use only. There are a lot of complications in core pieces of the runtime
* may break if this is used directly. For example op submission
*/
readonly outbound: IDeltaQueue<U[]>;

/**
* The queue of inbound delta signals
*/
Expand Down Expand Up @@ -241,6 +227,25 @@ export interface IDeltaManager<T, U>
submitSignal(content: any, targetClientId?: string): void;
}

/**
* DeltaManager which is used internally by the Fluid layers and not exposed to the end users.
* @sealed
* @legacy
* @alpha
jatgarg marked this conversation as resolved.
Show resolved Hide resolved
*/
export interface IDeltaManagerInternal<T = ISequencedDocumentMessage, U = IDocumentMessage>
extends IDeltaManager<T, U> {
/**
* The queue of inbound delta messages
*/
readonly inbound: IDeltaQueue<T>;

/**
* The queue of outbound delta messages
*/
readonly outbound: IDeltaQueue<U[]>;
}

/**
* Events emitted by {@link IDeltaQueue}.
* @sealed
Expand Down
1 change: 1 addition & 0 deletions packages/common/container-definitions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export { isFluidBrowserPackage } from "./browserPackage.js";
export type {
IConnectionDetails,
IDeltaManager,
IDeltaManagerInternal,
IDeltaManagerEvents,
jatgarg marked this conversation as resolved.
Show resolved Hide resolved
IDeltaQueue,
IDeltaQueueEvents,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ declare type old_as_current_for_Interface_IContainer = requireAssignableTo<TypeO
* typeValidation.broken:
* "Interface_IContainer": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_Interface_IContainer = requireAssignableTo<TypeOnly<current.IContainer>, TypeOnly<old.IContainer>>

/*
Expand All @@ -238,6 +239,7 @@ declare type old_as_current_for_Interface_IContainerContext = requireAssignableT
* typeValidation.broken:
* "Interface_IContainerContext": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_Interface_IContainerContext = requireAssignableTo<TypeOnly<current.IContainerContext>, TypeOnly<old.IContainerContext>>

/*
Expand Down Expand Up @@ -301,6 +303,7 @@ declare type current_as_old_for_TypeAlias_ICriticalContainerError = requireAssig
* typeValidation.broken:
* "Interface_IDeltaManager": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_Interface_IDeltaManager = requireAssignableTo<TypeOnly<current.IDeltaManager<any,any>>, TypeOnly<old.IDeltaManager<any,any>>>

/*
Expand Down
6 changes: 5 additions & 1 deletion packages/framework/aqueduct/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {}
"broken": {
"Interface_IDataObjectProps": {
"backCompat": false
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ declare type old_as_current_for_Interface_IDataObjectProps = requireAssignableTo
* typeValidation.broken:
* "Interface_IDataObjectProps": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_Interface_IDataObjectProps = requireAssignableTo<TypeOnly<current.IDataObjectProps>, TypeOnly<old.IDataObjectProps>>

/*
Expand Down
6 changes: 5 additions & 1 deletion packages/framework/fluid-static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {}
"broken": {
"Interface_IFluidContainerInternal": {
"backCompat": false
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ declare type old_as_current_for_Interface_IFluidContainerInternal = requireAssig
* typeValidation.broken:
* "Interface_IFluidContainerInternal": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_Interface_IFluidContainerInternal = requireAssignableTo<TypeOnly<current.IFluidContainerInternal>, TypeOnly<old.IFluidContainerInternal>>

/*
Expand Down
6 changes: 5 additions & 1 deletion packages/loader/container-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {}
"broken": {
"Interface_IContainerExperimental": {
"backCompat": false
}
}
}
}
10 changes: 5 additions & 5 deletions packages/loader/container-loader/src/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ export class Container
) => {
try {
assert(
this.deltaManager.inbound.length === 0,
this._deltaManager.inbound.length === 0,
0x0d6 /* "Inbound queue should be empty when attaching" */,
);
return combineAppAndProtocolSummary(
Expand Down Expand Up @@ -1520,13 +1520,13 @@ export class Container
const codeDetails = this.getCodeDetailsFromQuorum();

await Promise.all([
this.deltaManager.inbound.pause(),
this.deltaManager.inboundSignal.pause(),
this._deltaManager.inbound.pause(),
this._deltaManager.inboundSignal.pause(),
]);

if ((await this.satisfies(codeDetails)) === true) {
this.deltaManager.inbound.resume();
this.deltaManager.inboundSignal.resume();
this._deltaManager.inbound.resume();
this._deltaManager.inboundSignal.resume();
return;
}

Expand Down
6 changes: 2 additions & 4 deletions packages/loader/container-loader/src/deltaManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { ICriticalContainerError } from "@fluidframework/container-definitions";
import {
IDeltaManager,
IDeltaManagerInternal,
IDeltaManagerEvents,
IDeltaQueue,
type IDeltaSender,
Expand Down Expand Up @@ -155,9 +155,7 @@ function logIfFalse(
*/
export class DeltaManager<TConnectionManager extends IConnectionManager>
extends EventEmitterWithErrorHandling<IDeltaManagerInternalEvents>
implements
IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
IEventProvider<IDeltaManagerInternalEvents>
implements IDeltaManagerInternal, IEventProvider<IDeltaManagerInternalEvents>
{
public readonly connectionManager: TConnectionManager;

Expand Down
3 changes: 2 additions & 1 deletion packages/loader/container-loader/src/loadPaused.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
ILoader,
LoaderHeader,
type IContainer,
IDeltaManagerInternal,
} from "@fluidframework/container-definitions/internal";
import { IRequest } from "@fluidframework/core-interfaces";
import type { IErrorBase } from "@fluidframework/core-interfaces";
Expand Down Expand Up @@ -59,7 +60,7 @@ export async function loadContainerPaused(
// Force readonly mode - this will ensure we don't receive an error for the lack of join op
container.forceReadonly?.(true);

const dm = container.deltaManager;
const dm = container.deltaManager as IDeltaManagerInternal;
jatgarg marked this conversation as resolved.
Show resolved Hide resolved
const lastProcessedSequenceNumber = dm.initialSequenceNumber;

const pauseContainer = (): void => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ declare type old_as_current_for_Interface_IContainerExperimental = requireAssign
* typeValidation.broken:
* "Interface_IContainerExperimental": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_Interface_IContainerExperimental = requireAssignableTo<TypeOnly<current.IContainerExperimental>, TypeOnly<old.IContainerExperimental>>

/*
Expand Down
9 changes: 8 additions & 1 deletion packages/runtime/container-runtime-definitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {}
"broken": {
"Interface_IContainerRuntime": {
"backCompat": false
},
"Interface_IContainerRuntimeWithResolveHandle_Deprecated": {
"backCompat": false
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ declare type old_as_current_for_Interface_IContainerRuntime = requireAssignableT
* typeValidation.broken:
* "Interface_IContainerRuntime": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_Interface_IContainerRuntime = requireAssignableTo<TypeOnly<current.IContainerRuntime>, TypeOnly<old.IContainerRuntime>>

/*
Expand Down Expand Up @@ -85,4 +86,5 @@ declare type old_as_current_for_Interface_IContainerRuntimeWithResolveHandle_Dep
* typeValidation.broken:
* "Interface_IContainerRuntimeWithResolveHandle_Deprecated": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_Interface_IContainerRuntimeWithResolveHandle_Deprecated = requireAssignableTo<TypeOnly<current.IContainerRuntimeWithResolveHandle_Deprecated>, TypeOnly<old.IContainerRuntimeWithResolveHandle_Deprecated>>
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents
// (undocumented)
deleteChildSummarizerNode(id: string): void;
deleteSweepReadyNodes(sweepReadyRoutes: readonly string[]): readonly string[];
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
get deltaManager(): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
// (undocumented)
dispose(error?: Error): void;
// (undocumented)
Expand Down
48 changes: 47 additions & 1 deletion packages/runtime/container-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,52 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {}
"broken": {
"Class_LocalFluidDataStoreContext": {
"backCompat": false
},
"ClassStatics_LocalFluidDataStoreContext": {
"backCompat": false
},
"Class_LocalFluidDataStoreContextBase": {
"backCompat": false
},
"ClassStatics_LocalFluidDataStoreContextBase": {
"backCompat": false
},
"Class_ChannelCollection": {
"backCompat": false
},
"ClassStatics_ChannelCollection": {
"backCompat": false
},
"Class_ContainerRuntime": {
"backCompat": false
},
"ClassStatics_ContainerRuntime": {
"backCompat": false
},
"Class_FluidDataStoreContext": {
"backCompat": false
},
"ClassStatics_FluidDataStoreContext": {
"backCompat": false
},
"Interface_ISummarizerRuntime": {
"backCompat": false
},
"Interface_ILocalFluidDataStoreContextProps": {
"backCompat": false
},
"Interface_IFluidDataStoreContextInternal": {
"backCompat": false
},
"Interface_IFluidDataStoreContextProps": {
"backCompat": false
},
"Interface_ILocalDetachedFluidDataStoreContextProps": {
"backCompat": false
}
}
}
}
6 changes: 3 additions & 3 deletions packages/runtime/container-runtime/src/connectionTelemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { performance } from "@fluid-internal/client-utils";
import { IDeltaManager } from "@fluidframework/container-definitions/internal";
import { IDeltaManagerInternal } from "@fluidframework/container-definitions/internal";
import { IContainerRuntimeEvents } from "@fluidframework/container-runtime-definitions/internal";
import { IEventProvider } from "@fluidframework/core-interfaces";
import { assert } from "@fluidframework/core-utils/internal";
Expand Down Expand Up @@ -124,7 +124,7 @@ class OpPerfTelemetry {
/**
* DeltaManager instance to monitor.
*/
private readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
private readonly deltaManager: IDeltaManagerInternal,
/**
* Emitter of events for the container runtime.
*/
Expand Down Expand Up @@ -470,7 +470,7 @@ export interface IPerfSignalReport {
*/
export function ReportOpPerfTelemetry(
clientId: string | undefined,
deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
deltaManager: IDeltaManagerInternal,
containerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>,
logger: ITelemetryLoggerExt,
): void {
Expand Down
Loading
Loading