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

Fix field types in SubteamMembersChangedEvent #1064

Merged
merged 1 commit into from Jun 2, 2022

Conversation

youdofoo
Copy link
Contributor

AddedUsersCount and RemovedUsersCount fields in SubteamMembersChangedEvent struct are defined as a string type, but in fact these fields in received data from subteam_members_changed have a number type.
So when you use slackevents.ParseEvent function to this event, following parse error occurs:

EventsAPI Error parsing inner event: unmarshalling_error, json: cannot unmarshal number into Go struct field SubteamMembersChangedEvent.added_users_count of type string: wrapError

To fix this, I changed the type of AddedUsersCount and RemovedUsersCount fields from string to int.

By the way, also in API document, "added_users_count" and "removed_users_count" are defined as a string.
I already reported this to https://slack.com/help.

@kanata2 kanata2 added breaking changes spec changes Slack's specification changes spec undocumented Slack does not document yet labels May 18, 2022
Copy link
Member

@kanata2 kanata2 left a comment

Choose a reason for hiding this comment

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

LGTM.
This PR breaks backward compatibility, so I'm planning to release in v0.11.0.

@kanata2 kanata2 added this to the v0.11.0 milestone May 18, 2022
@kanata2 kanata2 merged commit 497c385 into slack-go:master Jun 2, 2022
@youdofoo youdofoo deleted the fix-SubteamMembersChangedEvent branch June 12, 2022 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking changes spec changes Slack's specification changes spec undocumented Slack does not document yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants