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

type BlockAction missing user.username member #1909

Closed
GovernmentHack opened this issue Jul 28, 2023 · 1 comment
Closed

type BlockAction missing user.username member #1909

GovernmentHack opened this issue Jul 28, 2023 · 1 comment
Assignees
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch TypeScript-specific
Milestone

Comments

@GovernmentHack
Copy link
Contributor

Reproducible in:

Documentation: per the block action payload documentation, you can see that the username is an expected field:

{
  "type": "block_actions",
  "team": {
    "id": "T9TK3CUKW",
    "domain": "example"
  },
  "user": {
    "id": "UA8RXUSPL",
    "username": "jtorrance", // <---- missing member on the type definition
    "team_id": "T9TK3CUKW"
  },

The output of a block action in the Block Kit Builder will also produce a block action with a username:
Screenshot 2023-07-28 at 4 27 30 PM

However in the definition for a block action in https://github.com/slackapi/bolt-js/blob/main/src/types/actions/block-action.ts#L219 the user object is missing the username member:

export interface BlockAction<ElementAction extends BasicElementAction = BlockElementAction> {
  type: 'block_actions';
  actions: ElementAction[];
  team: {
   // ...
  } | null;
  user: {
    id: string;
    name: string;
    team_id?: string; // undocumented
  };

The Slack SDK version

"slack/bolt": "3.13.2",
"slack/logger": "^3.0.0",
"slack/oauth": "^2.6.1",
"slack/socket-mode": "^1.3.2",
"slack/types": "^2.8.0",
"slack/web-api": "^6.8.1",

Node.js runtime version

v18.12.1

OS info

ProductName: macOS
ProductVersion: 13.4.1
ProductVersionExtra: (c)
BuildVersion: 22F770820d
Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000

Steps to reproduce:

  1. attempt to dereference the payload.user.username field from the output of any block action handler.

Expected result:

no error

Actual result:

type error
Screenshot 2023-07-28 at 4 24 17 PM

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 bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented TypeScript-specific and removed untriaged labels Jul 31, 2023
@seratch seratch added this to the 3.13.3 milestone Jul 31, 2023
@filmaj filmaj self-assigned this Aug 1, 2023
@filmaj
Copy link
Contributor

filmaj commented Aug 1, 2023

This was fixed in #1910.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch TypeScript-specific
Projects
None yet
Development

No branches or pull requests

3 participants