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 early for unknown action constraints #167

Merged

Conversation

aoberoi
Copy link
Contributor

@aoberoi aoberoi commented Apr 24, 2019

Summary

If you were to mistakenly use the wrong property name on action constraints to match an action listener, you'd end up running the listener for potentially every action. Here is an example:

app.action({ actionId: 'foo' }, listener);

In this case, actionId is not valid, and listener would be called for every action. This could have catastrophic results for an app in production.

Instead, it would be better if the listener was never called. We can accomplish this by returning before adding the listener to the processing pipeline, and that's what this PR does. Also, it prints an informative error message to the developer.

Requirements (place an x in each [ ])

@shaydewael shaydewael merged commit a0483b7 into slackapi:master Apr 24, 2019
@shaydewael shaydewael mentioned this pull request Apr 24, 2019
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants