Skip to main content

SchemaCompatibilitySnapshotsOptions Interface

The options for checkSchemaCompatibilitySnapshots(options).

This API is provided as an alpha preview and may change without notice.

To use, import via fluid-framework/alpha.

For more information about our API support guarantees, see here.

Input

This type is "input," meaning that code outside of the library defining it should not read from it. Future versions of this type may add optional members or make typing of members more general.

Signature

export interface SchemaCompatibilitySnapshotsOptions

Properties

PropertyAlertsModifiersTypeDescription
fileSystemAlphareadonlySnapshotFileSystemHow the snapshotDirectory is accessed.
minVersionForCollaborationAlphareadonlystringThe minimum version that the current version is expected to be able to collaborate with.
modeAlphareadonly"test" | "update"The mode of operation, either "test" or "update".
schemaAlphareadonlyTreeViewConfigurationThe current view schema.
snapshotDirectoryAlphareadonlystringDirectory where historical schema snapshots are stored.
snapshotUnchangedVersionsAlphaoptional, readonlytrueWhen true, every version must be snapshotted, and an increased version number will require a new snapshot.
versionAlphareadonlystringThe current application or library version.

Property Details

fileSystem

How the snapshotDirectory is accessed.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

readonly fileSystem: SnapshotFileSystem;

Type: SnapshotFileSystem

minVersionForCollaboration

The minimum version that the current version is expected to be able to collaborate with.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

readonly minVersionForCollaboration: string;

Type: string

Remarks

This defines a range of versions whose schema must be forwards compatible with trees using the current schema: Any schema from snapshots with a version greater than or equal to this must be able to view documents created with the current schema. This means that if the current schema is used to create a TreeView, then upgradeSchema() is used, the older clients, all the way back to this minVersionForCollaboration will be able to view and edit the tree using their schema and thus collaborate.

Typically applications will attempt to manage their deployment/update schedule such that all versions concurrently deployed can collaborate to avoid users losing access to documents when other users upgrade the schema. Such applications can set this to the oldest version currently deployed, then rely on checkSchemaCompatibilitySnapshots(options) to verify that no schema changes are made which would break collaboration with that (or newer) versions.

This is the same approach used by MinimumVersionForCollab except that type is specifically for use with the version of the Fluid Framework client packages, and this corresponds to the version of the application or library defining the schema.

mode

The mode of operation, either "test" or "update".

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

readonly mode: "test" | "update";

Type: "test" | "update"

Remarks

In "update" mode, a new snapshot is created if the current schema differs from the latest existing snapshot. Note: snapshotUnchangedVersions impacts this behavior.

In "test" mode, an error is thrown if running in "update" mode would have made any changes.

Both modes will throw errors if any compatibility issues are detected (but after updating snapshots in "update" mode so the diff can be used to help debug).

It is recommended that "test" mode be used in automated tests to verify schema compatibility, and "update" mode only be used manually to update snapshots when making schema changes (or version changes if snapshotUnchangedVersions is true).

schema

The current view schema.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

readonly schema: TreeViewConfiguration;

Type: TreeViewConfiguration

snapshotDirectory

Directory where historical schema snapshots are stored.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

readonly snapshotDirectory: string;

Type: string

snapshotUnchangedVersions

When true, every version must be snapshotted, and an increased version number will require a new snapshot.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

readonly snapshotUnchangedVersions?: true;

Type: true

Remarks

If this is true, it is assumed there is a snapshot for every release, and thus it is required that the minVersionForCollaboration refer to a version which has a snapshot. When this is not true, versions without snapshots are assumed to have the same schema as the latest previous version which has a snapshot, and thus minVersionForCollaboration can refer to versions between snapshots and will get its schema from the preceding version.

version

The current application or library version.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

readonly version: string;

Type: string

Remarks

This uses the ordering defined by semver. It is only compared against the version from previous snapshots (taken from this version when they were created by setting mode to "update") and the minVersionForCollaboration.