-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Unmarshal error on RTM, after updated to the new Slack version #630
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
Comments
It looks like before, this was the struct that parsed the incoming event https://github.com/nlopes/slack/blob/master/messages.go#L16-L20 But slack changed the type "message" object to |
Info from slack: https://api.slack.com/changelog/2019-09-what-they-see-is-what-you-get-and-more-and-less |
It seems that fix is already in master, but not yet tagged. The problem is caused by 'rich_text' block that is considered 'unknown' by v0.6.0. This causes "unsupported block type" unmarshalling error |
Can confirm that it works with the latest version from master |
Yes, the fix is in // UnmarshalJSON implements the Unmarshaller interface for Blocks, so that any JSON
// unmarshalling is delegated and proper type determination can be made before unmarshal
func (b *Blocks) UnmarshalJSON(data []byte) error {
...
switch blockType {
case "actions":
block = &ActionBlock{}
case "context":
block = &ContextBlock{}
case "divider":
block = &DividerBlock{}
case "image":
block = &ImageBlock{}
case "section":
block = &SectionBlock{}
case "rich_text":
// for now ignore the (complex) content of rich_text blocks until we can fully support it
continue
default:
return errors.New("unsupported block type")
} To fix problem in v0.6.0 the case "rich_text":
// for now ignore the (complex) content of rich_text blocks until we can fully support it
continue is enough to be added to that |
Unfortunately I can't make a PR to your repo since it is required to have target branch existing for PR. git checkout v0.6.0 // checkout to the tag
git cherry-pick c4750fe73d883a2b1edff13e0d2e09290512b405 // copy the fix from master to current branch
git tag v0.6.1 // bump version
git push --tags // push the changes into github |
It's fixed in #618 and latest |
Slack made some API changes (for the lovely WYSIWYG editor) which broke the ability for this library to parse private messages. Upstream issue https://github.com/nlopes/slack/issues/630
This works around the issue described at https://github.com/nlopes/slack/issues/630
Uh oh!
There was an error while loading. Please reload this page.
Hello,
We have a bot, that is set up something like
And when we're debugging in that
fmt.Printf
, we receive different messages if weping
the bot from older versions of slack on mobile vs the new slack on desktopOld version (mobile) debugging:
New version (desktop) debugging:
Are there any problems now with the new slack version, so they send a different kind of event now or something?
The text was updated successfully, but these errors were encountered: