{"record":{"id":"d28d8cd2e629e940","repo":"earendil-works/pi","slug":"pi-client-is-disposed","errorCode":null,"errorMessage":"Pi client is disposed","messagePattern":"Pi client is disposed","errorType":"exception","errorClass":"PiClientDisposedError","httpStatus":null,"severity":"error","filePath":"packages/client/src/client.ts","lineNumber":360,"sourceCode":"\tdispose(): Promise<void> {\n\t\tif (this.#disposePromise) return this.#disposePromise;\n\t\tthis.#disposed = true;\n\t\tthis.#disposePromise = Promise.resolve();\n\t\tconst error = new PiClientDisposedError();\n\t\tthis.#rejectPendingRequests(error);\n\t\tthis.#connection.disconnect(error);\n\t\tthis.#state.dispose();\n\t\tthis.#invalidateAllSessionLeases();\n\t\tthis.#connectionStateListeners.clear();\n\t\treturn this.#disposePromise;\n\t}\n\n\t[Symbol.asyncDispose](): Promise<void> {\n\t\treturn this.dispose();\n\t}\n\n\t#assertNotDisposed(): void {\n\t\tif (this.#disposed) throw new PiClientDisposedError();\n\t}\n\n\tasync #reconcileSessionCleanup(sessionId: string): Promise<boolean> {\n\t\tif (!this.#sessionCleanupRequired.has(sessionId)) return false;\n\t\tlet reconciliation = this.#sessionReconciliations.get(sessionId);\n\t\tif (!reconciliation) {\n\t\t\treconciliation = this.#request({ command: \"detach\", sessionId })\n\t\t\t\t.then(() => undefined)\n\t\t\t\t.then(() => {\n\t\t\t\t\tthis.#sessionCleanupRequired.delete(sessionId);\n\t\t\t\t})\n\t\t\t\t.finally(() => {\n\t\t\t\t\tthis.#sessionReconciliations.delete(sessionId);\n\t\t\t\t});\n\t\t\tthis.#sessionReconciliations.set(sessionId, reconciliation);\n\t\t}\n\t\tawait reconciliation;\n\t\treturn true;","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/client/src/client.ts#L342-L378","documentation":"Error \"Pi client is disposed\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/client/src/client.ts:360 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create a new PiClient; a disposed client cannot be used."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}