Skip to content

Error: MessageAction unmarshalling failed.  #596

@oscarzhou

Description

@oscarzhou

This problem happens when the interactive callback is triggered, the program parses the payload of the incoming request. The error is located in slackevents.ParseActionEvent().

In slackevents.ParseActionEvent() function, it uses the struct slackevents.MessageAction as the target struct, which is only compitible with AttachmentAction, but BlockAction. Unfortunately, my payload includes BlockAction.

AttachmentAction json sample:

"actions": [
                {
                    "name": "game",
                    "text": "Chess",
                    "type": "button",
                    "value": "chess"
                }
]

The good thing is that the InteractionCallback struct has defined to compatible with both AttachmentAction and BlockAction.

BlockAction json sample:

   "actions":[ 
      { 
         "action_id":"action123",
         "block_id":"block123",
         "text":{ 
            "type":"plain_text",
            "text":"Reply to me",
            "emoji":true
         },
         "type":"button",
         "action_ts":"1569304306.968465"
      }
   ]

In order to take advantages of the workflow of verifying the token in slackevents.ParseActionEvent(), I will simply replace MessageAction with slack.InteractionCallback in this function to fix the error in my PullRequest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions