Skip to content

Commit 96caadb

Browse files
committed
fix(whatsapp): treat 2xx mark-as-read as success unless body says success:false
1 parent 185c476 commit 96caadb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/sim/tools/whatsapp/mark_read.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,13 @@ export const markReadTool: ToolConfig<WhatsAppMarkReadParams, WhatsAppMarkReadRe
5959
throw new Error(errorMessage)
6060
}
6161

62+
// A 2xx response means the mark-as-read succeeded (Graph returns `{"success": true}`).
63+
// Treat the HTTP success as authoritative and only report failure if the body
64+
// explicitly says otherwise, so an empty or variant 200 body isn't misreported.
6265
return {
6366
success: true,
6467
output: {
65-
success: data.success === true,
68+
success: data.success !== false,
6669
},
6770
}
6871
},

0 commit comments

Comments
 (0)