diff --git a/packages/runtime/container-runtime/src/test/containerRuntime.spec.ts b/packages/runtime/container-runtime/src/test/containerRuntime.spec.ts index 16dad4546815..db50547d96fc 100644 --- a/packages/runtime/container-runtime/src/test/containerRuntime.spec.ts +++ b/packages/runtime/container-runtime/src/test/containerRuntime.spec.ts @@ -5,6 +5,7 @@ import { strict as assert } from "node:assert"; +import { UsageError } from "@fluidframework/telemetry-utils/internal"; import { stringToBuffer, type ILayerCompatDetails, @@ -3872,6 +3873,25 @@ describe("Runtime", () => { it("minVersionForCollab = 1.0.0", async () => { const minVersionForCollab = "1.0.0"; const logger = new MockLogger(); + await assert.rejects( + async () => { + await ContainerRuntime.loadRuntime2({ + context: getMockContext({ logger }) as IContainerContext, + registry: new FluidDataStoreRegistry([]), + existing: false, + runtimeOptions: {}, + provideEntryPoint: mockProvideEntryPoint, + minVersionForCollab, + }); + }, + (e) => + e instanceof UsageError && e.message.match(/Invalid minVersionForCollab/) !== null, + ); + }); + + it("minVersionForCollab = 1.4.0", async () => { + const minVersionForCollab = "1.4.0"; + const logger = new MockLogger(); await ContainerRuntime.loadRuntime2({ context: getMockContext({ logger }) as IContainerContext, registry: new FluidDataStoreRegistry([]), diff --git a/packages/runtime/runtime-utils/src/compatibilityBase.ts b/packages/runtime/runtime-utils/src/compatibilityBase.ts index 301f470d3764..0cdd7cca5728 100644 --- a/packages/runtime/runtime-utils/src/compatibilityBase.ts +++ b/packages/runtime/runtime-utils/src/compatibilityBase.ts @@ -34,17 +34,23 @@ export const defaultMinVersionForCollab = "2.0.0-defaults" as const satisfies MinimumVersionForCollab; /** - * We don't want allow a version before the major public release of the LTS version. - * Today we use "1.0.0", because our policy supports N/N-1 & N/N-2, which includes - * all minor versions of N. Though LTS starts at 1.4.0, we should stay consistent - * with our policy and allow all 1.x versions to be compatible with 2.x. + * The lowest supported value of {@link @fluidframework/runtime-definitions#MinimumVersionForCollab}. + * @remarks + * In each new major version, this may be bumped to indicate which version of the Fluid Framework client libraries are no longer supported for collaboration. + * @privateRemarks + * At the time this was defined (and also at the time 2.0 was released), all version of 1.x below 1.4 were no longer supported. + * Therefore it makes sense to not support any version below 1.4.0. + * Supporting 1.4 is sufficient to support all 1.x versions which were maintained at the time this constant was introduced. + * + * Future major versions will have to decide which versions of every supported major (including 1.x if still supported) they want to support. + * Continuing to support whatever version of 1.x is the oldest supported one at the time of the major release, would make sense for 3.0. * * @privateRemarks * Exported for use in tests. * * @internal */ -export const lowestMinVersionForCollab = "1.0.0" as const satisfies MinimumVersionForCollab; +export const lowestMinVersionForCollab = "1.4.0" as const satisfies MinimumVersionForCollab; /** * String in a valid semver format specifying bottom of a minor version