{"record":{"id":"6433aa7245cedd06","repo":"earendil-works/pi","slug":"not-found-6433aa","errorCode":"not_found","errorMessage":"Session not found: ${sessionId}","messagePattern":"Session not found: (.+?)","errorType":"error_code","errorClass":"SessionError","httpStatus":null,"severity":"error","filePath":"packages/session-backends/sqlite-node/src/sqlite/repo.ts","lineNumber":329,"sourceCode":"\nfunction matchesEntryQuery(entry: Entry, query: EntryQuery): boolean {\n\treturn (\n\t\t(query.type === undefined || entry.type === query.type) &&\n\t\t(query.customType === undefined || (entry.type === \"custom\" && entry.customType === query.customType)) &&\n\t\t(query.cursor === undefined ||\n\t\t\t(query.order === \"oldestFirst\" ? entry.seq > query.cursor.afterSeq : entry.seq < query.cursor.afterSeq))\n\t);\n}\n\nfunction assertUnusedId(db: SqliteDatabase, sessionId: string, id: string): void {\n\tif (idExistsInEntries(db, sessionId, id) || idExistsInRecords(db, sessionId, id)) {\n\t\tthrow new SessionError(\"already_exists\", `ID already exists: ${id}`);\n\t}\n}\n\nfunction requireSessionRow(db: SqliteDatabase, sessionId: string): SessionRow {\n\tconst row = readSessionRow(db, sessionId);\n\tif (!row) throw new SessionError(\"not_found\", `Session not found: ${sessionId}`);\n\treturn row;\n}\n\nclass SqliteSessionStorage implements SessionStorage<SqliteSessionMetadata> {\n\tprivate readonly db: SqliteDatabase;\n\tprivate readonly metadata: SqliteSessionMetadata;\n\tprivate readonly lease: WriterLease;\n\tprivate readonly leaseOptions: ResolvedWriterLeaseOptions;\n\tprivate readonly onRelease: () => void;\n\tprivate readonly operations = new SerialOperationQueue();\n\tprivate heartbeatTimer: ReturnType<typeof setTimeout> | undefined;\n\tprivate leaseError: SessionError | undefined;\n\tprivate closing = false;\n\tprivate releasePromise: Promise<void> | undefined;\n\n\tconstructor(\n\t\tdb: SqliteDatabase,\n\t\tmetadata: SqliteSessionMetadata,","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/session-backends/sqlite-node/src/sqlite/repo.ts#L311-L347","documentation":"Error \"Session not found: ${sessionId}\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/session-backends/sqlite-node/src/sqlite/repo.ts:329 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The session id does not exist; create the session or verify the id."],"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"}