Skip to content

Code breaks on receiving "user_change" event #406

@gaurav2493

Description

@gaurav2493

Issue Type

  • Bug
  • Enhancement / Feature request
  • Question
  • Documentation

Description

When user_change event is sent, the code breaks with the following exception

java.lang.UnsupportedOperationException: JsonObject

	at com.google.gson.JsonElement.getAsString(JsonElement.java:179)
	at com.slack.api.bolt.middleware.builtin.IgnoringSelfEvents.apply(IgnoringSelfEvents.java:79)

This happens because code expects user to contain string but it contained jsonObject

{
    "token": ".....",
    "team_id": ".....",
    "enterprise_id": "....",
    "api_app_id": "....",
    "event": {
        "type": "user_change",
        "user": {
            "id": "....",
            "name": "gaurav",
......
}

The issue is reproducible in:

  • Module Version: 1.0.0
  • JDK Version: 1.8.0_231

The steps to reproduce are:

  1. subscribe to user_change event
  2. Change any field to produce webhook

The expected result is:
Event to get handled

The actual result is:
exception is thrown


  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Metadata

Metadata

Assignees

Labels

bugM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documentedproject:bolt

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions