{"record":{"id":"3fc5294b0dc84364","repo":"earendil-works/pi","slug":"invalid-entry-3fc529","errorCode":"invalid_entry","errorMessage":"Branch tip ${parentId} changed during append","messagePattern":"Branch tip (.+?) changed during append","errorType":"error_code","errorClass":"SessionError","httpStatus":null,"severity":"error","filePath":"packages/session-backends/sqlite-node/src/sqlite/branch-cache.ts","lineNumber":66,"sourceCode":"\t\t\t`Failed to build SQLite branch cache at entry ${leafId}`,\n\t\t\terror instanceof Error ? error : undefined,\n\t\t);\n\t}\n}\n\nfunction extendBranch(\n\tdb: SqliteDatabase,\n\tsessionId: string,\n\tbranchId: string,\n\tparentId: string,\n\tentryId: string,\n\tentrySeq: number,\n\tentryType: string,\n\tcustomType: string | null,\n) {\n\tinsertBranchEntry(db, sessionId, branchId, entryId, entrySeq, entryType, customType);\n\tif (!updateBranchTip(db, sessionId, branchId, parentId, entryId)) {\n\t\tthrow new SessionError(\"invalid_entry\", `Branch tip ${parentId} changed during append`);\n\t}\n}\n\nexport function appendEntryToBranchCache(\n\tdb: SqliteDatabase,\n\tsessionId: string,\n\tentryId: string,\n\tentrySeq: number,\n\tentryType: string,\n\tcustomType: string | null,\n\tparentId: string | null,\n) {\n\tif (parentId === null) {\n\t\tconst branchId = uuidv7();\n\t\tinsertBranchEntry(db, sessionId, branchId, entryId, entrySeq, entryType, customType);\n\t\tinsertBranchTip(db, sessionId, entryId, branchId);\n\t\treturn;\n\t}","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/session-backends/sqlite-node/src/sqlite/branch-cache.ts#L48-L84","documentation":"Error \"Branch tip ${parentId} changed during append\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/session-backends/sqlite-node/src/sqlite/branch-cache.ts:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["A concurrent append changed the branch tip; retry the append."],"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"}