Skip to content

Need help to run lazy listeners in response to view_submission requests on AWS Lambda #521

Closed
@ashalobodin

Description

@ashalobodin

I can't receive a response from a lazy function (in AWS lambda).
Although, the same AWS lambda was working a few days ago.

Reproducible in:

from slack_bolt import App
from slack_bolt.adapter.aws_lambda import SlackRequestHandler

app = App(process_before_response=True)


def respond_to_slack_within_3_seconds(ack):
    ack()


def handle_freeform_submission(body, client, view):
    slack_user_id = body['user']['id']
    time.sleep(5)
    client.chat_postMessage(channel=slack_user_id, text='some msg')


app.view('create_doc')(ack=respond_to_slack_within_3_seconds, lazy=[handle_freeform_submission])


def lambda_handler(event, context):
    logger.info(f'Received event: {event}')
    slack_handler = SlackRequestHandler(app=app)
    return slack_handler.handle(event, context)

The slack_bolt version

slack-bolt 1.9.2 # and any above
slack-sdk 3.11.2

Python runtime version

python3.7

Steps to reproduce:

are the same as in Issue #490

Expected result:

The function handle_freeform_submission should be called and send its result to a user.

Actual result:

Modal (code base not presented) opens and could be submitted with data
But the lazy function doesn't seem to be even called.

Here is a piece of lambda logs:
Screenshot 2021-11-11 at 21 03 27

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions