Skip to content

ack() delayed due to network latency causing event repetition in async Bolt app #1355

@PrajwalNaik07

Description

@PrajwalNaik07

Description

When using the async Bolt for Python SDK (slack_bolt==1.23.0), I noticed that calling await ack() inside an event handler (e.g., app_mention) sometimes takes around 3 seconds due to network delays. This delay causes Slack to resend the event multiple times because it does not receive the acknowledgment promptly.

Reproduction Steps

  1. Set up an async Bolt app with event handler for app_mention.
  2. Call await ack() inside the handler.
  3. Deploy the app.
  4. Mention the bot in Slack.
  5. Observe that if await ack() is delayed (~3 seconds), Slack retries the event, causing duplicates.

Expected behavior

ack() should respond immediately to Slack’s event request to prevent retries, even if the rest of the event processing takes longer.

Actual behavior

await ack() delays due to network latency and event processing, causing Slack to resend the event multiple times.

Code snippet

@app.event("app_mention")
async def bot_mention(event, body, say, client, logger, ack):
    await ack()  # This sometimes takes ~3 seconds due to network delay
    # Additional event processing...

Environment

slack_bolt==1.23.0
slack_sdk==3.36.0
Bolt for Python (async)
Slack workspace with necessary permissions and subscriptions
Python 3.8+

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions