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

Add event type name validation & channel_type filter middleware #757

Closed
seratch opened this issue Jan 15, 2021 · 1 comment · Fixed by #857
Closed

Add event type name validation & channel_type filter middleware #757

seratch opened this issue Jan 15, 2021 · 1 comment · Fixed by #857
Labels
discussion M-T: An issue where more input is needed to reach a decision enhancement M-T: A feature request for new functionality
Milestone

Comments

@seratch
Copy link
Member

seratch commented Jan 15, 2021

The Events API document says "you can subscribe message.channels events" but this could be confusing for developers. message.channels is not an event type but a concatenated string value {event.type}.{event.channel_type}.

I propose two solutions for improving developer experience in regard to this matter.

Add a simple validation for event type in constraints

Bolt framework can suggest the right way to configure message event constraints by raising a validation error.

Add a built-in middleware to filter message events with event.channel_type.

We may want to add a built-in reusable middleware to filter message type events by channel_type. But I think this is optional.

@aoberoi @stevengill @mwbrooks @misscoded
We may want to add the same validation to Bolt for JS and Bolt for Java. If there is no objection to it, I am happy to work on it. Thoughts?

Originally posted by @seratch in slackapi/bolt-python#201 (comment)

@gitwave gitwave bot added the untriaged label Jan 15, 2021
@seratch seratch added discussion M-T: An issue where more input is needed to reach a decision enhancement M-T: A feature request for new functionality and removed untriaged labels Jan 15, 2021
@stevengill
Copy link
Member

This sounds like a great addition @seratch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion M-T: An issue where more input is needed to reach a decision enhancement M-T: A feature request for new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants