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

MemberJoinedChannelEvent interface doesn't contain "enterprise" field #2139

Open
1 of 7 tasks
valkirilov opened this issue Jan 14, 2025 · 0 comments
Open
1 of 7 tasks
Labels
area:typescript issues that specifically impact using the package from typescript projects bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented pkg:types applies to `@slack/types`

Comments

@valkirilov
Copy link

valkirilov commented Jan 14, 2025

I’ve been playing with the member_joined_channel event and have noticed that the corresponding interface for this event might be outdated. Examining the payload of the event I received, I found the enterprise field, which contains the ID of the Slack organization, but it’s absent from the interface itself.

 event: {
    type: 'member_joined_channel',
    user: '***',
    channel: '***',
    channel_type: 'C',
    team: '***',
    inviter: '***',
    enterprise: '***',
    event_ts: '1736863796.000500'
  }

Is this intentional, or was it added at some point later by the web API, but the interface definition was not updated accordingly?

Packages:

Select all that apply:

  • @slack/web-api
  • @slack/rtm-api
  • @slack/webhooks
  • @slack/oauth
  • @slack/socket-mode
  • @slack/types
  • I don't know

Reproducible in:

The Slack SDK version

"slack/bolt": "^4.2.0",
"slack-block-builder": "^2.8.0",

Node.js runtime version

v20.9.0

OS info

ProductName: macOS
ProductVersion: 15.2
BuildVersion: 24C101
Darwin Kernel Version 24.2.0: Fri Dec 6 19:01:59 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6000

Steps to reproduce:

  1. Simply, setup an Event Listener with Bolt:
app.event('member_joined_channel', memberJoinedChannelCallback);

const memberJoinedChannelCallback = async ({
  client,
  event,
}: {
  client: WebClient;
  event: MemberJoinedChannelEvent;
}) => {
  console.log('Member Joined Channel event');
  console.log({ event });
});

Result:

 event: {
    type: 'member_joined_channel',
    user: '***',
    channel: '***',
    channel_type: 'C',
    team: '***',
    inviter: '***',
    enterprise: '***',
    event_ts: '1736863796.000500'
  }

Expected result:

Add the enterprise field to the interface, so it will correspond to the actual payloads that we receive.

Actual result:

Currently, the enterprise field is missing in the interface definition:

@seratch seratch added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented area:typescript issues that specifically impact using the package from typescript projects pkg:types applies to `@slack/types` and removed untriaged labels Jan 14, 2025
@seratch seratch added this to the [email protected] milestone Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:typescript issues that specifically impact using the package from typescript projects bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented pkg:types applies to `@slack/types`
Projects
None yet
Development

No branches or pull requests

2 participants