@yorkie-js/sdk
    Preparing search index...

    Interface SessionLock

    SessionLock is a pluggable, single-active-session guard used by the offline persistence path. Offline persistence derives a stable actor from the app's clientKey, so two browser tabs of the same app+user share that actor. Two live tabs would then share one server checkpoint and mint colliding clientSeq values — silent edit loss. The guard elects a single active session per document key so the second tab fails fast instead of corrupting the store.

    The abstraction is injectable so it can be tested without a real browser: the default WebLocksSessionLock is backed by the Web Locks API, and tests pass an in-memory fake.

    interface SessionLock {
        acquire(name: string): Promise<SessionLockHandle | undefined>;
    }

    Implemented by

    Index

    Methods

    Methods