github microsoft/FluidFramework client_v2.111.0
Fluid Framework v2.111.0 (minor)

5 hours ago

Contents

  • ✨ New Features
    • Add originatorless normalization for op-space IDs in id-compressor (#27367)
  • 🌳 SharedTree DDS Changes
    • TreeView transaction APIs have been promoted to beta (#27545)
    • Add an opt-in postProcessor option when running a transaction (#27610)
  • 🐛 Bug Fixes
    • Fix container crash when read-only mode is forced from a connected event handler (#27637)

✨ New Features

Add originatorless normalization for op-space IDs in id-compressor (#27367)

IIdCompressor now includes tryNormalizeToSessionSpaceWithoutSession(id). This API supports recovery scenarios where an op-space identifier must be decoded without the originating session id.

For finalized IDs, the method returns the correct session-space form. For non-final IDs, it returns undefined to indicate that originator context is required and callers should use normalizeToSessionSpace(id, originSessionId) when that context is available.

const maybeSessionId =
  idCompressor.tryNormalizeToSessionSpaceWithoutSession(opId);
if (maybeSessionId === undefined) {
  const sessionId = idCompressor.normalizeToSessionSpace(opId, originatorId);
  // use sessionId
} else {
  // use maybeSessionId
}

IIdCompressor is now marked @sealed. Fluid already assumed any IIdCompressor was its own implementation and casted them internally. Any custom implementations will no longer build due to the above change, but would not have worked at runtime anyway. The updated tagging now correctly documents this requirement.

Change details

Commit: 4af4094

Affected packages:

  • @fluidframework/id-compressor

⬆️ Table of contents

🌳 SharedTree DDS Changes

TreeView transaction APIs have been promoted to beta (#27545)

The TreeViewBeta interface exposes runTransaction and runTransactionAsync methods.

The asBeta helper function can be used to down-cast a TreeView to a TreeViewBeta.

import { asBeta } from "fluid-framework/beta";
// ...
const view = asBeta(tree.viewWith(config));
const result = view.runTransaction(() => {
  // ... make edits to the tree ...
});
if (result.success === false) {
  // ... handle the failed transaction ...
}

Important

Transaction constraints are not yet available as a part of the beta transaction APIs. These capabilities can still be accessed via the updated alpha APIs.

Type Name Changes

With the introduction of new beta types, existing alpha types have been replaced with new alpha and beta variants.

Old New Alpha New Beta
RunTransactionParams RunTransactionParamsAlpha RunTransactionParamsBeta
TransactionCallbackStatus TransactionCallbackStatusAlpha TransactionCallbackStatusBeta
VoidTransactionCallbackStatus VoidTransactionCallbackStatusAlpha VoidTransactionCallbackStatusBeta

Other Renames

  • TransactionResult (alpha) -> TransactionVoidResult (beta)
  • TransactionResultExt (alpha) -> TransactionValueResult (beta)

Change details

Commit: e121ff7

Affected packages:

  • @fluidframework/tree
  • fluid-framework

⬆️ Table of contents

Add an opt-in postProcessor option when running a transaction (#27610)

RunTransactionParams now accepts an optional postProcessor (used by runTransaction and runTransactionAsync). When supplied, the edits made during the transaction are post-processed when the transaction is committed, transforming the resulting squashed change. For example, post-processing could be used to "minimize" the change so that it contains no extraneous information. Such extraneous information includes data for nodes that were both created and removed within the transaction, or changes whose effects cancel out to nothing.

postProcessor is a type-erased handle (TransactionPostProcessor) whose concrete representation is an implementation detail of @fluidframework/tree. It is opt-in: when it is omitted the existing behavior is preserved.

Note: minimization is the first intended implementation and use of post-processing, but it is not yet available.

Change details

Commit: ee98110

Affected packages:

  • @fluidframework/tree
  • fluid-framework

⬆️ Table of contents

🐛 Bug Fixes

Fix container crash when read-only mode is forced from a connected event handler (#27637)

Forcing a container into read-only mode synchronously from within a "connected" event handler could leave an internal catch-up monitor in an inconsistent state, causing a later reconnection to fail with an assert ("catchUpMonitor should be gone", 0x3eb).

This occurred when a client established an already-caught-up read connection and application code reacted to the resulting connection transition by disconnecting (for example, by forcing read-only mode). The catch-up monitor is now stored before it can synchronously notify listeners, so a re-entrant disconnect during the connection transition is handled correctly and subsequent reconnections proceed normally.

Change details

Commit: 32bbb06

Affected packages:

  • @fluidframework/container-loader

⬆️ Table of contents

🛠️ Start Building Today!

Please continue to engage with us on GitHub Discussion and Issue pages as you adopt Fluid Framework!

Don't miss a new FluidFramework release

NewReleases is sending notifications on new releases.