Skip to content

Commit f9072e8

Browse files
authored
fix(slack): set delete_original to False when responding to webhooks (#73590)
1 parent 81265bc commit f9072e8

File tree

1 file changed

+11
-4
lines changed
  • src/sentry/integrations/slack/webhooks

1 file changed

+11
-4
lines changed

src/sentry/integrations/slack/webhooks/action.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,15 @@ def _handle_group_actions(
566566
try:
567567
private_metadata = orjson.loads(view.private_metadata)
568568
webhook_client = WebhookClient(private_metadata["orig_response_url"])
569-
webhook_client.send(blocks=json_blocks)
569+
webhook_client.send(
570+
blocks=json_blocks, delete_original=False, replace_original=True
571+
)
570572
logger.info(
571573
"slack.webhook.view_submission.success",
572-
extra={"integration_id": slack_request.integration.id},
574+
extra={
575+
"integration_id": slack_request.integration.id,
576+
"blocks": json_blocks,
577+
},
573578
)
574579
except SlackApiError as e:
575580
logger.error(
@@ -687,10 +692,12 @@ def _handle_group_actions(
687692
json_blocks = orjson.dumps(response.get("blocks")).decode()
688693
webhook_client = WebhookClient(response_url)
689694
try:
690-
webhook_client.send(blocks=json_blocks)
695+
webhook_client.send(
696+
blocks=json_blocks, delete_original=False, replace_original=True
697+
)
691698
logger.info(
692699
"slack.webhook.update_status.success",
693-
extra={"integration_id": slack_request.integration.id},
700+
extra={"integration_id": slack_request.integration.id, "blocks": json_blocks},
694701
)
695702
except SlackApiError as e:
696703
logger.error("slack.webhook.update_status.response-error", extra={"error": str(e)})

0 commit comments

Comments
 (0)