Repository navigation
Fix #644 app.message listener does not handle events when a file is attached - #645
Conversation
Codecov Report
@@ Coverage Diff @@
## main #645 +/- ##
=======================================
Coverage 92.04% 92.04%
=======================================
Files 170 170
Lines 5793 5793
=======================================
Hits 5332 5332
Misses 461 461
Continue to review full report at Codecov.
|
filmaj
left a comment
There was a problem hiding this comment.
Thanks for this change!
Regarding the potential breaking change to line up behaviour with bolt-js, my view on this is that consistency between bolt-js and bolt-python is more a nicety for us as maintainers rather than for bolt users. I think bolt users would probably stay with one language, generally, and therefore not expect identical behaviour if they move to a different language for bolt? What does everyone else think?
If the above assumption is accurate or agreed on by the rest of the team, then releasing a breaking change just to improve maintainers lives seems heavy-handed and should not be done just for that one change. However, if we have other, user-facing breaking changes we would like to land, then adding the subtype matching change in together with other breaking changes in the next major release may make sense.
|
Just wanted to add to the discussion for some context. I can confirm that there are teams who work with a combination of our SDKs across sectors, and one of them noticed the inconsistency first and brought it up to support, so this is in response to user feedback. |
|
Thank you for that additional context @celestinojones, your input helps make sure we are in line with customer expectations 🙏 |
|
@filmaj @celestinojones Thanks for the comments! As for other subtypes apart from file_share, we may want to revisit in the future if it's worth. However, I think that we should not decide to simply change the app.message listener behavior without any options to opt-in (for existing bolt-python apps). I have to say that the subtypes in message events are tricky in the nature. We can be more careful than usual for the behavior change. Either way, this file_share subtype pattern is an obvious bug, so that we should fix this as early as possible. Thus, we can merge this PR for the upcoming patch version release now. Thanks for the review and discussion! |
This pull request resolves #644
When it comes to the feature parity with bolt-js, we may want to remove the subtype constraints in bolt-python. bolt-js does not check any subtypes when matching message text in
app.messagelisteners: https://github.com/slackapi/bolt-js/blob/%40slack/bolt%403.11.0/src/App.ts#L602-L615That being said, changing bolt-python app.message listeners to handle other message patterns by Slack product (e.g., channel_join, channel_posting_permissions) could be a breaking change to existing apps. Also, more importantly, passing message_changed and so on would require code changes on the bolt-python user side for sure plus the behavior should not be desired at all.
For this reason, I didn't change the part drastically and went with just adding file_share subtype to the allowed list.
Category (place an
xin each of the[ ])slack_bolt.Appand/or its core componentsslack_bolt.async_app.AsyncAppand/or its core componentsslack_bolt.adapter/docsRequirements (place an
xin each[ ])Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
./scripts/install_all_and_run_tests.shafter making the changes.