Conditional Lazy Listener?
Maintainer thường phản hồi trong vòng 1 ngày
@seratch đang làm issue này rồi.
Từ ngày 4/10/2021.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Is there a way to make it so that the lazy function triggers conditionally based on the ack response?
For example, I want my ack to do parameter validation and potentially reject the request. Right now, my solution is to have the lazy function run the same parameter validation as the ack function, but it seems a bit wasteful. I'd much rather the lazy function not get triggered at all in the scenario where the ack function returns errors to the user.
Reproducible in:
The slack_bolt version
slack-bolt==1.9.1
Python runtime version
Python 3.8.12
OS info
ProductName: macOS
ProductVersion: 11.5.2
BuildVersion: 20G95
Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64
Steps to reproduce:
Run something like this:
def validate_the_stuff(ack, view):
#errors = validate_inputs(view)
errors = { "environment-select-block": "Nope" }
if len(errors) > 0:
ack(response_action="errors", errors=errors)
return False
else:
ack(response_action="clear")
def do_the_thing(view):
logging.error("You should not get this far")
app.view_submission('environment_select_submit')(
ack=validate_the_stuff,
lazy=[do_the_thing]
)
Expected result:
Don't do the thing if validation fails.
Actual result:
Does the thing even if validation fails.
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.
- Ngôn ngữ chính
- Python
- Star
- 1.3k
- Fork
- 300
- Merge trung bình
- 19 giờ 33 phút
- Pull request đã merge (30 ngày)
- 25
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của slackapi/bolt-python
-
`extract_team_id` crashes with `TypeError when payload["user"]` is a string (e.g. `member_joined_channel` events)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởauto-triage-skip bug security semver:major
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
slackapi/bolt-python#1447 · 9 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
auto-triage-stale
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
slackapi/bolt-python#1599 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Error handlers that take args: Args crash with a missing 'next' argumentCó thể đã có người làm @sahiljagtap08 đã nhận 42 ngày trước. Đang mởauto-triage-stale
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
slackapi/bolt-python#1598 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Assistant listener middleware crashes when given a plain functionCó thể đã có người làm @sahiljagtap08 đã nhận 42 ngày trước. Đang mởauto-triage-stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 30/100
slackapi/bolt-python#1597 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
AsyncOAuthFlow raises UnboundLocalError on org-wide install without a bot tokenCó thể đã có người làm @sahiljagtap08 đã nhận 42 ngày trước. Đang mởauto-triage-stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
slackapi/bolt-python#1596 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của slackapi/bolt-python
Issue tương tự
-
[Bug]: reme CLI crashes when the running server used a relative config pathCó thể đã có người làm @nurlanmnn đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
agentscope-ai/ReMe#770 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Pi: paused model calls are reported as "not signed in" when the model's provider comes from an extensionCó thể đã có người làm @balcsida đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
microsoft/TokenEconomizer#288 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 67/100
sickn33/agentic-awesome-skills#2437 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
site-bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ethereum/consensus-specs#5846 ·
Maintainer thường phản hồi trong vòng 1 ngày