Fix #1414 botMessage handler in Assistant middleware does not work when other event listeners do not exist#1415
Merged
seratch merged 1 commit intoslackapi:mainfrom Jan 11, 2025
Conversation
… work when other event listeners do not exist
seratch
commented
Jan 11, 2025
| .enterpriseId(context.get("enterprise_id") != null ? context.get("enterprise_id").getAsString() : null) | ||
| .teamId(context.get("team_id") != null ? context.get("team_id").getAsString() : null) | ||
| .channelId(context.get("channel_id") != null ? context.get("channel_id").getAsString() : null) | ||
| // enterprise_id here can be a null value |
Contributor
Author
There was a problem hiding this comment.
while testing this change, I found that this pattern could result in a runtime error. I don't think this was the same when we released this feature but the error needs to be eliminated anyway
| this.getContext().setChannelId(event.get("channel").getAsString()); | ||
| if (event.get("thread_ts") != null) { | ||
| if (event.get("thread_ts") != null | ||
| && !event.get("thread_ts").isJsonNull()) { |
Contributor
Author
There was a problem hiding this comment.
this property cannot be null but for safety...
| map.put("enterpriseId", this.enterpriseId); | ||
| map.put("teamId", this.teamId); | ||
| map.put("channelId", this.channelId); | ||
| map.put("thread_entry_point", this.threadEntryPoint); |
Contributor
Author
There was a problem hiding this comment.
This property was added recently
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1415 +/- ##
============================================
- Coverage 73.26% 73.24% -0.02%
+ Complexity 4369 4368 -1
============================================
Files 474 474
Lines 14172 14182 +10
Branches 1429 1433 +4
============================================
+ Hits 10383 10388 +5
+ Misses 2951 2950 -1
- Partials 838 844 +6 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request resolves a bug reported in #1414. I overlooked this pattern because my example apps, used to verify their behavior, always had app.event listeners.
Category (place an
xin each of the[ ])Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.