-
Notifications
You must be signed in to change notification settings - Fork 426
MessageEvent type definition does not match event data when subtype is 'message_changed' #311
Copy link
Copy link
Closed
Labels
TypeScript-specificbugM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documentedM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented
Description
Description
Concerning TypeScript, there seems to be a mismatch between message event type definitions and the actual events from Slack. For instance the following example would cause unexpected errors due to message_changed events:
app.message(({ message }) => {
const user: string = message.user
if (user.match(/^U/)) {
// ...
}
})The type definition does not allow message.user to be undefined, but in reality it may be when the subtype is message_changed. This issue is easy to work around by filtering by subtype, but these type safety breaking issues can be fiendishly difficult to detect.
What type of issue is this?
- bug
- enhancement (feature request)
- question
- documentation related
- testing related
- discussion
Requirements
- I've read and understood the Contributing guidelines and have done my best effort to follow them.
- I've read and agree to the Code of Conduct.
- I've searched for any related issues and avoided creating a duplicate issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
TypeScript-specificbugM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documentedM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented