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

The Field in the 'users.profile.get' response does not seem to have a 'label' type. #1452

Closed
1 of 6 tasks
75asa opened this issue Mar 27, 2022 · 1 comment · Fixed by #1453
Closed
1 of 6 tasks

The Field in the 'users.profile.get' response does not seem to have a 'label' type. #1452

75asa opened this issue Mar 27, 2022 · 1 comment · Fixed by #1453
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:web-api applies to `@slack/web-api`
Milestone

Comments

@75asa
Copy link

75asa commented Mar 27, 2022

(Describe your issue and goal here)

Packages:

Select all that apply:

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

Reproducible in:

npm ls | grep -o "\S\+@\S\+$" | tr @ ' ' | awk -v q='"' '{print q$1q": "q"^"$2q","}' | grep slack
node --version
sw_vers && uname -v # or `ver`

The Slack SDK version

6.7.0

Python runtime version

v17.0.0

OS info

macOS Monterey
Version 12.3

MacBook Pro (14-inch, 2021)
Chip Apple M1 Pro
Memory 32 GB
Startup Disk Macintosh HD
Serial Number R147VN4OXO

Steps to reproduce:

    const profileResponse = await app.client.users.profile.get({
      user: userId,
      include_labels: true,
    });

Question

The Field in the 'users.profile.get' response does not seem to have a 'label' type.

There is a Field type in profile.fields in the 'users.profile.get' response, which is currently as follows in src

export interface Field {
    value?: string;
    alt?: string;
}

But actually, when you enable the option include_labels: true as shown below, you will get the following response.

    const profileResponse = await app.client.users.profile.get({
      user: userId,
      include_labels: true,
    });
{
  // ...
  fields: {
    Xf09R6614KQS: { value: 'U012FEZ9BQ8', alt: '', label: 'Manager' }
    Xf0179U2GMGR: { value: 'Engineering', alt: '', label: 'Division' }
    Xf047M335YN4: { value: 'SlackApp Developer', alt: '', label: 'Title' }
  },
  // ...
}

I read the source below.

export interface Field {
value?: string;
alt?: string;
}

If it is listed elsewhere, we would like to know.

Expected result:

export interface Field {
    value?: string;
    alt?: string;
    label?: string;
}

Actual result:

export interface Field {
    value?: string;
    alt?: string;
}

Requirements

For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

@seratch seratch added area:typescript issues that specifically impact using the package from typescript projects pkg:web-api applies to `@slack/web-api` bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented and removed untriaged labels Mar 27, 2022
@seratch seratch added this to the web-api@6.8.0 milestone Mar 27, 2022
@seratch
Copy link
Member

seratch commented Mar 27, 2022

Hi @75asa, thanks for reporting this. This issue will be resolved in the next release.

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:web-api applies to `@slack/web-api`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants