perspective-dev/perspective · error

psp_opfs_store failed

Error message

psp_opfs_store failed

What it means

Warn emitted by the OPFS-backed perspective server store layer when a handle name supplied by the wasm server is not present in the JS handle map during the truncate/write callback. The surrounding code notes this should be unreachable, since commit only evicts handles opened at the safepoint, so firing indicates a server/JS handle bookkeeping desync or an eviction race.

Solutions

  1. Verify the wasm server and JS store build are from the same version; mismatched builds can change the handle protocol
  2. Check for concurrent table writes that could trigger commit eviction mid-operation
  3. Enable debug logging on the server to identify which operation name was not found
  4. Report the sequence of persistence calls preceding the failure, as it likely indicates a store bug
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at rust/perspective-js/src/ts/wasm/perspective-server.poly.ts:119 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of perspective-dev/perspective@11c8238c0c (2026-09-09). Data as JSON: /api/errors/dc22ea176fd646a0. Report an issue: GitHub.

Appendix: source

Thrown at rust/perspective-js/src/ts/wasm/perspective-server.poly.ts:119

                dataPtr: number | bigint,
                len: number,
            ): number {
                try {
                    const ah = handles.get(readCString(namePtr));
                    if (!ah) {
                        // `commit` only evicts victims whose handle the safepoint
                        // just opened, so this should be unreachable.
                        return -1;
                    }
                    ah.truncate(len);
                    if (len > 0) {
                        const addr = toAddr(dataPtr);
                        ah.write(heap().subarray(addr, addr + len), { at: 0 });
                    }
                    ah.flush();
                    return len;
                } catch (e) {
                    err("psp_opfs_store failed", e);
                    return -1;
                }
            },
            load(
                namePtr: number | bigint,
                dataPtr: number | bigint,
                len: number,
            ): number {
                try {
                    if (len <= 0) {
                        return 0;
                    }
                    const ah = handles.get(readCString(namePtr));
                    // A restore always follows an evict that left the handle open;
                    // a miss (or never-flushed file) reads as zeros.
                    if (!ah) {
                        return 0;
                    }

View on GitHub (pinned to 11c8238c0c)