-
Notifications
You must be signed in to change notification settings - Fork 399
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
MessageEvent type definition does not match event data when subtype is 'message_changed' #311
Comments
Sorry for our belated response and thank you for taking the time to share this. I will check this issue. |
Let me share my current understanding of this issue. As pointed out here, the data structure of Currently, types to be used for events is determined by only I'm going to come up with a solution that doesn't bring any breaking changes to existing TypeScript apps, but I'm still not 100% sure if it's possible yet. |
@seratch makes a good point here: it would be useful for the i think in the short term, the right thing to do is to make the i think we avoided this until now because we knew that some properties are different, and that app developers who knew what they were doing could simply cast to the more specific kind of event when they knew they were dealing with it. we even provided a built-in middleware, the newer pattern in Bolt has been to avoid using middleware for filtering events when they can potentially change the type, and instead add properties to the |
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:The type definition does not allow
message.user
to beundefined
, but in reality it may be when the subtype ismessage_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?
Requirements
The text was updated successfully, but these errors were encountered: