-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
[FIX] Broken slack compatible webhook #11742
Conversation
})); | ||
|
||
if (typeof(attachmentField.value) !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to enforce it as String? I think it's fine to keep it saved in the original format, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rodrigok initially I didn't convert. But looking at slack's it looks like they are converting to string so added.
But yeah I don't think it matters so much since all accepted will easily be converted to string when displayed in UI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll ping mobile teams and see which is better compatible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rodrigok confirmed with mobile. Because both clients are using typed languages having as a string is the best way.
@RocketChat/core lets make sure we get this merged on next release. Having to personally use the script provided here: #11506 (comment) a script shouldn't be needed for a slack payload |
const validateAttachmentsFields = (attachmentFields) => { | ||
check(attachmentFields, objectMaybeIncluding({ | ||
const validateAttachmentsFields = (attachmentField) => { | ||
check(attachmentField, objectMaybeIncluding({ | ||
short: Boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mind merging these two checks? 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
Closes #11506
I added integer as a safe type. Also added Boolean. Both of which I can see being used, and are safe toString.
Are there any other that are safe to string we could/should include?