Skip to content

appendMessage

const appendMessage: (message, files, session?) => Promise<number> = sqliteRepo.appendMessage

Defined in: src/lib/repositories/chat-history.ts:37

Atomically append a message, its files, and the session’s active-leaf pointer. A live session snapshot may be supplied to repair a missing session row — originally for rows lost to a stale or competing per-page database, which a single owner no longer produces. The repair stays because the caller can still reach here with a session the database has not seen: a UI that optimistically created one, or a restore that landed between the two writes.

Omit<StoredMessage, "id">

FileAttachment & object[] = []

ChatSession

Promise<number>