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
25 changes: 25 additions & 0 deletions .changeset/nice-flies-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
"@fluidframework/aqueduct": minor
"@fluidframework/container-definitions": minor
"@fluidframework/container-loader": minor
"@fluidframework/container-runtime": minor
"@fluidframework/container-runtime-definitions": minor
"@fluidframework/datastore": minor
"@fluidframework/devtools-core": minor
"@fluidframework/fluid-static": minor
"@fluidframework/runtime-definitions": minor
"@fluidframework/runtime-utils": minor
"@fluid-private/test-end-to-end-tests": minor
"@fluidframework/test-runtime-utils": minor
"@fluidframework/test-utils": minor
---
---
"section": legacy
---

The inbound and outbound properties have been removed from IDeltaManager

The inbound and outbound properties were deprecated in a previous release and have been removed from IDeltaManager. Please check pull request [#19636](https://github.com/microsoft/FluidFramework/pull/19636) for alternative APIs.
Copy link
Contributor

@Josmithr Josmithr Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend including the migration / replacement API instructions directly here, rather than linking to a PR / release notes. That's a lot of navigation steps for our users to jump through to get the information they need.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will paste here. I added link to the release notes as well. But I can certainly copy those here.


This is the link to the [Release Notes](https://github.com/microsoft/FluidFramework/blob/main/RELEASE_NOTES/2.0.0-rc.2.0.0.md#container-definitions-deprecate-ideltamanagerinbound-and-ideltamanageroutbound)
which contains more instructions on the alternatives.
Original file line number Diff line number Diff line change
Expand Up @@ -204,17 +204,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 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,7 +114,17 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {},
"broken": {
"Interface_IContainer": {
"backCompat": false
},
"Interface_IContainerContext": {
"backCompat": false
},
"Interface_IDeltaManager": {
"backCompat": false
}
},
"entrypoint": "legacy"
}
}
41 changes: 27 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,33 @@ 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.
* @internal
*/
export interface IDeltaManagerFull<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[]>;
}

/**
* Type guard to check if the given deltaManager is of type {@link @fluidframework/container-definitions#IDeltaManagerFull}.
* @internal
*/
export function isIDeltaManagerFull(
deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
): deltaManager is IDeltaManagerFull {
return "inbound" in deltaManager && "outbound" in deltaManager;
}

/**
* Events emitted by {@link IDeltaQueue}.
* @sealed
Expand Down
2 changes: 2 additions & 0 deletions packages/common/container-definitions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ export type {
IConnectionDetails,
IDeltaManager,
IDeltaManagerEvents,
IDeltaManagerFull,
IDeltaQueue,
IDeltaQueueEvents,
IDeltaSender,
ReadOnlyInfo,
} from "./deltas.js";
export { isIDeltaManagerFull } from "./deltas.js";
export type { ContainerWarning, ICriticalContainerError } from "./error.js";
export { ContainerErrorTypes } from "./error.js";
export type {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,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 @@ -211,6 +212,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 @@ -256,6 +258,7 @@ declare type current_as_old_for_Interface_IContainerLoadMode = requireAssignable
* 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 @@ -156,7 +156,11 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {},
"broken": {
"Interface_IDataObjectProps": {
"backCompat": false
}
},
"entrypoint": "legacy"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,5 @@ 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>>
6 changes: 5 additions & 1 deletion packages/framework/fluid-static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {},
"broken": {
"Interface_IFluidContainerInternal": {
"backCompat": false
}
},
Comment on lines +143 to +147
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very naive - is this safe? cc: @ChumpChief

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The breaking changes will have these. However, since we first deprecated it and now properly removing it, then it is fine.

"entrypoint": "public"
}
}
6 changes: 5 additions & 1 deletion packages/loader/container-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {},
"broken": {
"Interface_IContainerExperimental": {
"backCompat": false
}
},
"entrypoint": "legacy"
}
}
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 @@ -1319,7 +1319,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 @@ -1523,13 +1523,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,8 +5,8 @@

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

Expand Down
5 changes: 4 additions & 1 deletion packages/loader/container-loader/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export {
resolveWithLocationRedirectionHandling,
} from "./location-redirection-utilities/index.js";
export { IProtocolHandler, ProtocolHandlerBuilder } from "./protocol.js";
export { tryParseCompatibleResolvedUrl, IParsedUrl } from "./utils.js";
export {
tryParseCompatibleResolvedUrl,
IParsedUrl,
} from "./utils.js";
export {
IBaseProtocolHandler,
IScribeProtocolState,
Expand Down
3 changes: 3 additions & 0 deletions packages/loader/container-loader/src/loadPaused.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@

import {
ILoader,
isIDeltaManagerFull,
LoaderHeader,
type IContainer,
} from "@fluidframework/container-definitions/internal";
import { IRequest } from "@fluidframework/core-interfaces";
import type { IErrorBase } from "@fluidframework/core-interfaces";
import { assert } from "@fluidframework/core-utils/internal";
import { GenericError } from "@fluidframework/telemetry-utils/internal";

/* eslint-disable jsdoc/check-indentation */
Expand Down Expand Up @@ -63,6 +65,7 @@ export async function loadContainerPaused(
const lastProcessedSequenceNumber = dm.initialSequenceNumber;

const pauseContainer = (): void => {
assert(isIDeltaManagerFull(dm), "Delta manager does not have inbound/outbound queues.");
// eslint-disable-next-line no-void
void dm.inbound.pause();
// eslint-disable-next-line no-void
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,7 +103,14 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {},
"broken": {
"Interface_IContainerRuntime": {
"backCompat": false
},
"Interface_IContainerRuntimeWithResolveHandle_Deprecated": {
"backCompat": false
}
},
"entrypoint": "legacy"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ declare type MakeUnusedImportErrorsGoAway<T> = TypeOnly<T> | MinimalType<T> | Fu
* 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 @@ -49,6 +50,7 @@ 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>>

/*
Expand Down
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
54 changes: 53 additions & 1 deletion packages/runtime/container-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,59 @@
"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
},
"Class_DocumentsSchemaController": {
"forwardCompat": 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
},
"Interface_LoadContainerRuntimeParams": {
"backCompat": false
}
},
"entrypoint": "legacy"
}
}
Loading
Loading