Skip to content

Commit aca974d

Browse files
committed
fix(agentmail): guard messageId and label remappings with operation checks
1 parent 59000bd commit aca974d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

apps/sim/blocks/blocks/agentmail.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ export const AgentMailBlock: BlockConfig = {
500500
rest.replyAll = replyAll === 'true'
501501
}
502502

503-
if (replyMessageId) {
503+
if (operation === 'reply_message' && replyMessageId) {
504504
rest.messageId = replyMessageId
505505
}
506506

@@ -510,19 +510,19 @@ export const AgentMailBlock: BlockConfig = {
510510
rest.to = undefined
511511
}
512512

513-
if (forwardMessageId) {
513+
if (operation === 'forward_message' && forwardMessageId) {
514514
rest.messageId = forwardMessageId
515515
}
516516

517-
if (updateMessageId) {
517+
if (operation === 'update_message' && updateMessageId) {
518518
rest.messageId = updateMessageId
519519
}
520520

521-
if (msgAddLabels) {
521+
if (operation === 'update_message' && msgAddLabels) {
522522
rest.addLabels = msgAddLabels
523523
}
524524

525-
if (msgRemoveLabels) {
525+
if (operation === 'update_message' && msgRemoveLabels) {
526526
rest.removeLabels = msgRemoveLabels
527527
}
528528

0 commit comments

Comments
 (0)