Skip to content
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

Parse string or boolean for SlashCommand.IsEnterpriseInstall #1266

Merged

Conversation

kpaulisse
Copy link
Contributor

This PR adds a custom JSON parser for the SlashCommand struct to work correctly when "is_enterprise_install" comes in as either a string or a boolean. As noted in the issue, in socket mode, certain (but not all 🤷) payloads have "is_enterprise_install" as a quoted boolean (e.g. "false") whereas others have it as an actual boolean (e.g. false).

This doesn't update the IsEnterpriseInstall field in SlashCommand itself, so this change should be transparent to anyone who might have started using that newly added field.

Fixes #1265
Prior fix attempt: #1264

Testing:

  1. Added unit test covering happy paths and error cases
  2. My application works correctly pointing at this branch

Copy link
Member

@parsley42 parsley42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for writing the tests, LGTM.

@parsley42 parsley42 merged commit af783b3 into slack-go:master Feb 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Release 0.21.4 breaks slash commands in socket mode
2 participants