@vestra-player/sdk - v1.11.3
    Preparing search index...

    Variable SESSION_STORAGE_LIMITSConst

    SESSION_STORAGE_LIMITS: Readonly<
        { keyBytes: 1024; bytes: number; entryBytes: 128 },
    > = ...

    The player's limits on SessionStorage. A key outside them fails with code invalid; a set that would make the plugin's entries larger than bytes fails with limit and changes nothing. A single set must also fit in one message to the player (MESSAGE_LIMIT, 1 MiB with the key and the request around the value). The player's tests check that these agree with the player.

    The plugin keeps the last position of each URL for this player session and skips a URL too long to be a key. Keys are counted in UTF-8 bytes, so the length is measured with Buffer.byteLength, not length; a set that would take the plugin's entries over 1 MiB rejects with limit and changes nothing, so the plugin clears the old entries and goes on.

    import { SESSION_STORAGE_LIMITS } from "@vestra-player/sdk/testing";

    const session = plugin.storage.session;
    if (Buffer.byteLength(url) <= SESSION_STORAGE_LIMITS.keyBytes) {
    try {
    await session.set(url, position);
    } catch (error) {
    if ((error as PluginError).code !== "limit") throw error;
    // Full: start over rather than lose the newest position.
    for (const key of await session.keys()) await session.delete(key);
    await session.set(url, position);
    }
    }

    1.5.25