tam0wT
Convex Community4mo ago
5 replies
tam0w

DeleteByOrder not working

🪲Bug Report
Facing an issue with the convex-agent,

I think the docs are kinda outdated for deleting messages. I've tried using deletebyorder, but it just only deletes one message, not the ones after that, not till the end of the thread? Am I using it correctly to delete messages? I want to delete all messages after a certain message, the use case is: a user edits a message in the conversation, I delete all the messages in the thread including that, and then resend the updated message in the thread

const result = await ctx.runMutation(
components.agent.messages.deleteByOrder,
{
threadId: threadId as any,
startOrder: messageOrder,
endOrder: messageOrder + 63,
}
);

console.log(messageOrder, result)


This is what I got in my log when I did my editMessage mutation, which deletes here ^ and then sends a message

27/11/2025, 10:01:53 am [CONVEX M(messages:editMessage)] [LOG] 1 {
isDone: true,
lastOrder: 1,
lastStepOrder: 1
}
image.png
Was this page helpful?