CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-fluidframework--container-loader

Fluid container loader providing core container loading functionality for the Fluid Framework

57%

Overall

Evaluation57%

0.98x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-6/

Pending Edit Recovery Helper

Build a helper that persists unsent collaborative edits when connectivity drops and replays them on restart using the collaboration loader's pending-state resume flow.

Capabilities

Capture pending edits on shutdown

  • When provided an active collaborative container that has locally generated but unsent operations and a session id, savePendingEdits captures a serialized pending-state string and writes it to the store for that session, returning the same string. If the container has no pending local work, it returns undefined and does not overwrite existing entries. @test

Resume from saved state

  • If a pending-state string exists for the session, loadWithPendingRecovery should start the container from that state instead of doing a fresh load, and resolve only after the resumed container reports connectivity. @test

Fresh load when nothing saved

  • If the store has no entry for the session, loadWithPendingRecovery should call the provided fresh-load factory and return that container without touching the store. @test

Cleanup after sync

  • After recovering from a stored pending state and once the container has processed all pending operations, the store entry is cleared so subsequent loads don't replay the same edits. @test

Implementation

@generates

API

export interface PendingStateStore {
  read(sessionId: string): Promise<string | undefined>;
  write(sessionId: string, serializedState: string): Promise<void>;
  clear(sessionId: string): Promise<void>;
}

export interface CollaborationContainer {
  readonly connected: boolean;
  on(event: "connected" | "disconnected", listener: () => void): void;
  once(event: "connected", listener: () => void): void;
}

export interface LoadWithRecoveryConfig {
  sessionId: string;
  store: PendingStateStore;
  loadFresh(): Promise<CollaborationContainer>;
  loadFromPending(serializedState: string): Promise<CollaborationContainer>;
  onRecovered?(container: CollaborationContainer): Promise<void> | void;
}

export async function savePendingEdits(
  container: CollaborationContainer,
  store: PendingStateStore,
  sessionId: string
): Promise<string | undefined>;

export async function loadWithPendingRecovery(
  config: LoadWithRecoveryConfig
): Promise<CollaborationContainer>;

Dependencies { .dependencies }

@fluidframework/container-loader { .dependency }

Provides collaborative container loading and pending-state resume support needed for capturing and rehydrating local changes.

tessl i tessl/npm-fluidframework--container-loader@2.60.0

tile.json