Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to make a deep copy of request with custom props for lazy listeners #545

Closed
2 of 4 tasks
seratch opened this issue Dec 12, 2021 · 0 comments · Fixed by #546
Closed
2 of 4 tasks

Fail to make a deep copy of request with custom props for lazy listeners #545

seratch opened this issue Dec 12, 2021 · 0 comments · Fixed by #546
Assignees
Labels
area:async area:sync bug Something isn't working
Milestone

Comments

@seratch
Copy link
Member

seratch commented Dec 12, 2021

While making my personal Slack apps, I found room for improvement in the lazy listener mechanism. The issue can be easily reproduced by running the following code.

The occurrence conditions of this issue are:

  • Add custom properties to context object
  • Use lazy listeners

Thus, the usage that will be supported by #544 will be also affected.

app = App()

@app.middleware
def set_db_connection(context, next_):
    # When making a deep copy of context fails due to an error "cannot pickle SSLContext object" etc.
    context["s3"] = boto3.client("s3")
    next_()

def just_ack(ack):
    ack()

def do_something(client, body):
    pass

app.command(ack=just_ack, lazy=[do_something])

Category (place an x in each of the [ ])

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter
  • Others

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.

@seratch seratch added this to the 1.11.0 milestone Dec 12, 2021
@seratch seratch self-assigned this Dec 12, 2021
seratch added a commit to seratch/bolt-python that referenced this issue Dec 13, 2021
@seratch seratch added bug Something isn't working and removed enhancement New feature or request labels Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:async area:sync bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant