-
Notifications
You must be signed in to change notification settings - Fork 540
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
improvement(client): misc cleanup #23959
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,72 +3,75 @@ | |
* Licensed under the MIT License. | ||
*/ | ||
|
||
import { | ||
Trace, | ||
TypedEventEmitter, | ||
type ILayerCompatDetails, | ||
type IProvideLayerCompatDetails, | ||
import type { | ||
ILayerCompatDetails, | ||
IProvideLayerCompatDetails, | ||
} from "@fluid-internal/client-utils"; | ||
import { | ||
AttachState, | ||
import { Trace, TypedEventEmitter } from "@fluid-internal/client-utils"; | ||
import type { | ||
IAudience, | ||
ISelf, | ||
ICriticalContainerError, | ||
type IAudienceEvents, | ||
IAudienceEvents, | ||
} from "@fluidframework/container-definitions"; | ||
import { | ||
import { AttachState } from "@fluidframework/container-definitions"; | ||
import type { | ||
IContainerContext, | ||
IGetPendingLocalStateProps, | ||
ILoader, | ||
IRuntime, | ||
LoaderHeader, | ||
IDeltaManager, | ||
IDeltaManagerFull, | ||
isIDeltaManagerFull, | ||
} from "@fluidframework/container-definitions/internal"; | ||
import { | ||
LoaderHeader, | ||
isIDeltaManagerFull, | ||
} from "@fluidframework/container-definitions/internal"; | ||
import type { | ||
IContainerRuntime, | ||
IContainerRuntimeEvents, | ||
} from "@fluidframework/container-runtime-definitions/internal"; | ||
import { | ||
import type { | ||
FluidObject, | ||
IFluidHandle, | ||
IRequest, | ||
IResponse, | ||
ITelemetryBaseLogger, | ||
} from "@fluidframework/core-interfaces"; | ||
import { | ||
type IErrorBase, | ||
import type { | ||
IErrorBase, | ||
IFluidHandleContext, | ||
type IFluidHandleInternal, | ||
IFluidHandleInternal, | ||
IProvideFluidHandleContext, | ||
ISignalEnvelope, | ||
} from "@fluidframework/core-interfaces/internal"; | ||
import { ISignalEnvelope } from "@fluidframework/core-interfaces/internal"; | ||
import { | ||
assert, | ||
Deferred, | ||
LazyPromise, | ||
PromiseCache, | ||
delay, | ||
} from "@fluidframework/core-utils/internal"; | ||
import { | ||
import type { | ||
IClientDetails, | ||
IQuorumClients, | ||
ISummaryTree, | ||
SummaryType, | ||
} from "@fluidframework/driver-definitions"; | ||
import { | ||
DriverHeader, | ||
FetchSource, | ||
import { SummaryType } from "@fluidframework/driver-definitions"; | ||
import type { | ||
IDocumentStorageService, | ||
type ISnapshot, | ||
IDocumentMessage, | ||
ISequencedDocumentMessage, | ||
ISignalMessage, | ||
ISnapshot, | ||
ISnapshotTree, | ||
ISummaryContent, | ||
ISummaryContext, | ||
} from "@fluidframework/driver-definitions/internal"; | ||
import { | ||
DriverHeader, | ||
FetchSource, | ||
MessageType, | ||
ISequencedDocumentMessage, | ||
ISignalMessage, | ||
type ISummaryContext, | ||
} from "@fluidframework/driver-definitions/internal"; | ||
import { readAndParse } from "@fluidframework/driver-utils/internal"; | ||
import type { IIdCompressor } from "@fluidframework/id-compressor"; | ||
|
@@ -78,13 +81,11 @@ import type { | |
SerializedIdCompressorWithNoSession, | ||
SerializedIdCompressorWithOngoingSession, | ||
} from "@fluidframework/id-compressor/internal"; | ||
import { | ||
import type { | ||
ISummaryTreeWithStats, | ||
ITelemetryContext, | ||
IGarbageCollectionData, | ||
CreateChildSummarizerNodeParam, | ||
FlushMode, | ||
FlushModeExperimental, | ||
IDataStore, | ||
IEnvelope, | ||
IFluidDataStoreContextDetached, | ||
|
@@ -93,11 +94,15 @@ import { | |
InboundAttachMessage, | ||
NamedFluidDataStoreRegistryEntries, | ||
SummarizeInternalFn, | ||
IInboundSignalMessage, | ||
IRuntimeMessagesContent, | ||
ISummarizerNodeWithGC, | ||
} from "@fluidframework/runtime-definitions/internal"; | ||
import { | ||
FlushMode, | ||
FlushModeExperimental, | ||
channelsTreeName, | ||
gcTreeKey, | ||
IInboundSignalMessage, | ||
type IRuntimeMessagesContent, | ||
type ISummarizerNodeWithGC, | ||
} from "@fluidframework/runtime-definitions/internal"; | ||
import { | ||
GCDataBuilder, | ||
|
@@ -112,19 +117,19 @@ import { | |
seqFromTree, | ||
} from "@fluidframework/runtime-utils/internal"; | ||
import type { | ||
IEventSampler, | ||
IFluidErrorBase, | ||
ITelemetryGenericEventExt, | ||
ITelemetryLoggerExt, | ||
MonitoringContext, | ||
TelemetryEventPropertyTypeExt, | ||
} from "@fluidframework/telemetry-utils/internal"; | ||
import { | ||
ITelemetryLoggerExt, | ||
DataCorruptionError, | ||
DataProcessingError, | ||
extractSafePropertiesFromMessage, | ||
GenericError, | ||
IEventSampler, | ||
LoggingError, | ||
MonitoringContext, | ||
PerformanceEvent, | ||
// eslint-disable-next-line import/no-deprecated | ||
TaggedLoggerAdapter, | ||
|
@@ -565,7 +570,7 @@ export interface IContainerRuntimeOptions { | |
* | ||
* These options are not available to consumers when creating a new container runtime, | ||
* but we do need to expose them for internal use, e.g. when configuring the container runtime | ||
* to ensure compability with older versions. | ||
* to ensure compatibility with older versions. | ||
* | ||
* @internal | ||
*/ | ||
|
@@ -952,7 +957,7 @@ export class ContainerRuntime | |
context: IContainerContext; | ||
registryEntries: NamedFluidDataStoreRegistryEntries; | ||
existing: boolean; | ||
runtimeOptions?: IContainerRuntimeOptions; // May also include options from IContainerRuntimeOptionsInternal | ||
runtimeOptions?: IContainerRuntimeOptionsInternal; | ||
containerScope?: FluidObject; | ||
containerRuntimeCtor?: typeof ContainerRuntime; | ||
/** | ||
|
@@ -967,7 +972,7 @@ export class ContainerRuntime | |
existing, | ||
requestHandler, | ||
provideEntryPoint, | ||
runtimeOptions = {} satisfies IContainerRuntimeOptions, | ||
runtimeOptions = {} satisfies IContainerRuntimeOptionsInternal, | ||
containerScope = {}, | ||
containerRuntimeCtor = ContainerRuntime, | ||
} = params; | ||
|
@@ -1552,7 +1557,7 @@ export class ContainerRuntime | |
electedSummarizerData: ISerializedElection | undefined, | ||
chunks: [string, string[]][], | ||
dataStoreAliasMap: [string, string][], | ||
baseRuntimeOptions: Readonly<Required<IContainerRuntimeOptions>>, | ||
runtimeOptions: Readonly<Required<IContainerRuntimeOptionsInternal>>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yay |
||
private readonly containerScope: FluidObject, | ||
// Create a custom ITelemetryBaseLogger to output telemetry events. | ||
public readonly baseLogger: ITelemetryBaseLogger, | ||
|
@@ -1574,7 +1579,7 @@ export class ContainerRuntime | |
// the defaults | ||
...DefaultSummaryConfiguration, | ||
// the runtime configuration overrides | ||
...baseRuntimeOptions.summaryOptions?.summaryConfigOverrides, | ||
...runtimeOptions.summaryOptions?.summaryConfigOverrides, | ||
}, | ||
recentBatchInfo?: [number, string][], | ||
) { | ||
|
@@ -1606,11 +1611,6 @@ export class ContainerRuntime | |
const maybeLoaderCompatDetails = context as FluidObject<ILayerCompatDetails>; | ||
validateLoaderCompatibility(maybeLoaderCompatDetails.ILayerCompatDetails, this.disposeFn); | ||
|
||
// Backfill in defaults for the internal runtimeOptions, since they may not be present on the provided runtimeOptions object | ||
const runtimeOptions = { | ||
flushMode: defaultFlushMode, | ||
...baseRuntimeOptions, | ||
}; | ||
this.mc = createChildMonitoringContext({ | ||
logger: this.baseLogger, | ||
namespace: "ContainerRuntime", | ||
|
@@ -1883,6 +1883,8 @@ export class ContainerRuntime | |
// what is the interface of passing signals, we need the | ||
// downstream stores to wrap the signal. | ||
parentContext.submitSignal = (type: string, content: unknown, targetClientId?: string) => { | ||
// Can the `content` argument type be IEnvelope? | ||
// verifyNotClosed is called in FluidDataStoreContext, which is *the* expected caller. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this a note to self? Not sure it should be checked in in its current state There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not self notes really. I changed the first to be a Future: comment and the latter is just interesting to know. |
||
const envelope1 = content as IEnvelope; | ||
const envelope2 = this.createNewSignalEnvelope( | ||
envelope1.address, | ||
|
@@ -2146,7 +2148,7 @@ export class ContainerRuntime | |
summaryFormatVersion: metadata?.summaryFormatVersion, | ||
disableIsolatedChannels: metadata?.disableIsolatedChannels, | ||
gcVersion: metadata?.gcFeature, | ||
options: JSON.stringify(baseRuntimeOptions), | ||
options: JSON.stringify(runtimeOptions), | ||
idCompressorModeMetadata: metadata?.documentSchema?.runtime?.idCompressorMode, | ||
idCompressorMode: this.sessionSchema.idCompressorMode, | ||
sessionRuntimeSchema: JSON.stringify(this.sessionSchema), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any changes here should also happen for
loadContainerRuntime
free function (seeLoadContainerRuntimeParams
). We probably should update this to use that params type. Or just get rid of it, unless we really need an internal version that returns concreteContainerRuntime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, obviously we can't make these changes on
LoadContainerRuntimeParams
because that's not@internal
. This is fine for now.