{"record":{"id":"dc22ea176fd646a0","repo":"perspective-dev/perspective","slug":"psp-opfs-store-failed","errorCode":null,"errorMessage":"psp_opfs_store failed","messagePattern":"psp_opfs_store failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/perspective-js/src/ts/wasm/perspective-server.poly.ts","lineNumber":119,"sourceCode":"                dataPtr: number | bigint,\n                len: number,\n            ): number {\n                try {\n                    const ah = handles.get(readCString(namePtr));\n                    if (!ah) {\n                        // `commit` only evicts victims whose handle the safepoint\n                        // just opened, so this should be unreachable.\n                        return -1;\n                    }\n                    ah.truncate(len);\n                    if (len > 0) {\n                        const addr = toAddr(dataPtr);\n                        ah.write(heap().subarray(addr, addr + len), { at: 0 });\n                    }\n                    ah.flush();\n                    return len;\n                } catch (e) {\n                    err(\"psp_opfs_store failed\", e);\n                    return -1;\n                }\n            },\n            load(\n                namePtr: number | bigint,\n                dataPtr: number | bigint,\n                len: number,\n            ): number {\n                try {\n                    if (len <= 0) {\n                        return 0;\n                    }\n                    const ah = handles.get(readCString(namePtr));\n                    // A restore always follows an evict that left the handle open;\n                    // a miss (or never-flushed file) reads as zeros.\n                    if (!ah) {\n                        return 0;\n                    }","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/perspective-dev/perspective/blob/11c8238c0c9c0b9e490b5a6a2dc277afad1e980a/rust/perspective-js/src/ts/wasm/perspective-server.poly.ts#L101-L137","documentation":"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.","triggerScenarios":"Thrown at rust/perspective-js/src/ts/wasm/perspective-server.poly.ts:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the wasm server and JS store build are from the same version; mismatched builds can change the handle protocol","Check for concurrent table writes that could trigger commit eviction mid-operation","Enable debug logging on the server to identify which operation name was not found","Report the sequence of persistence calls preceding the failure, as it likely indicates a store bug"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"11c8238c0c9c0b9e490b5a6a2dc277afad1e980a","analyzedAt":"2026-09-09T00:35:19.377Z","contentChangedAt":"2026-09-09T00:35:19.377Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}