Skip to content

deleteMessageSubtree

const deleteMessageSubtree: (messageId) => Promise<DeletedMessageSubtree | undefined> = sqliteRepo.deleteMessageSubtree

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

Delete one message and every descendant as a single SQLite commit.

Descendant discovery belongs inside the transaction: computing the tree in the UI before opening the transaction lets a concurrent append escape the delete. Files have no message foreign key, so they must be removed in the same transaction rather than relying on cascade behavior.

number

Promise<DeletedMessageSubtree | undefined>