fix(batch): edit message in place instead of delete+send

- Skip Delete Batch Select Message node for batch start
- Use editMessageText instead of sendMessage
- Batch start now smoothly transitions like batch stop

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lucas Berger
2026-02-04 16:41:07 -05:00
parent 23f60ff043
commit a8c9ab69d6
+1 -12
View File
@@ -3394,7 +3394,7 @@
}, },
{ {
"parameters": { "parameters": {
"jsCode": "// Store progress message ID and prepare first iteration\nlet batchState;\ntry {\n batchState = $('Initialize Batch State').item.json;\n} catch (e) {\n throw new Error('Failed to get Initialize Batch State: ' + e.message);\n}\n\nif (!batchState || !batchState.containers || !Array.isArray(batchState.containers)) {\n throw new Error('Invalid batch state');\n}\n\n// Use the original messageId from Initialize Batch State\n// (we now edit the confirmation message instead of sending a new one)\nconst progressMessageId = batchState.messageId || null;\n\n// Return single item with all data for manual loop\n// We'll process containers[currentIndex] and increment\nreturn {\n json: {\n containers: batchState.containers,\n currentIndex: 0,\n container: batchState.containers[0],\n action: batchState.action,\n totalCount: batchState.totalCount,\n chatId: batchState.chatId,\n progressMessageId: progressMessageId,\n successCount: 0,\n failureCount: 0,\n warningCount: 0,\n results: [],\n fromKeyboard: batchState.fromKeyboard || false\n }\n};" "jsCode": "// Store progress message ID and prepare first iteration\nlet batchState;\ntry {\n batchState = $('Initialize Batch State').item.json;\n} catch (e) {\n throw new Error('Failed to get Initialize Batch State: ' + e.message);\n}\n\nif (!batchState || !batchState.containers || !Array.isArray(batchState.containers)) {\n throw new Error('Invalid batch state');\n}\n\n// Use the original messageId from Initialize Batch State\n// (we edit the batch select message in place)\nconst progressMessageId = batchState.messageId || null;\n\n// Return single item with all data for manual loop\n// We'll process containers[currentIndex] and increment\nreturn {\n json: {\n containers: batchState.containers,\n currentIndex: 0,\n container: batchState.containers[0],\n action: batchState.action,\n totalCount: batchState.totalCount,\n chatId: batchState.chatId,\n progressMessageId: progressMessageId,\n successCount: 0,\n failureCount: 0,\n warningCount: 0,\n results: [],\n fromKeyboard: batchState.fromKeyboard || false\n }\n};"
}, },
"id": "code-prepare-batch-loop", "id": "code-prepare-batch-loop",
"name": "Prepare Batch Loop", "name": "Prepare Batch Loop",
@@ -6548,17 +6548,6 @@
] ]
}, },
"Answer Batch Exec Immediate Query": { "Answer Batch Exec Immediate Query": {
"main": [
[
{
"node": "Delete Batch Select Message",
"type": "main",
"index": 0
}
]
]
},
"Delete Batch Select Message": {
"main": [ "main": [
[ [
{ {