slackapi/hubot-slack

msg.envelope.user.name doesn't match any Slack profile fields

Closed this issue · 2 comments

Description

I'm debugging a new setup

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • 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.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

hubot-slack version: 4.8.0

node version: 14.10 (from node:latest docker image)

OS version(s): Debian 9 Stretch (from node:latest docker image)

Steps to reproduce:

  1. Dump msg.envelope.user.name to the console
  2. Dump msg.envelope.user.slack to the console

Expected result:

msg.envelope.user.name would correspond to some value found in msg.envelope.user.slack

Actual result:

msg.envelope.user.name doesn't match anything in msg.envelope.user.slack.profile

Attachments:

This is a dump of msg.envelope.user.slack

  {
    id: 'XXXXXXXX',
    team_id: 'XXXXXXXXX',
    name: 'mike',
    deleted: false,
    color: '3c989f',
    real_name: 'Michael Prasuhn (he/him)',
    tz: 'America/New_York',
    tz_label: 'Eastern Daylight Time',
    tz_offset: -14400,
    profile: {
      title: 'XXXXXXX',
      phone: '',
      skype: '',
      real_name: 'Michael Prasuhn (he/him)',
      real_name_normalized: 'Michael Prasuhn (he/him)',
      display_name: 'mikey_p',
      display_name_normalized: 'mikey_p',
      fields: [],
      status_text: '',
      status_emoji: '',
      status_expiration: 0,
      avatar_hash: '1e0696b258be',
      image_original: 'https://avatars.slack-edge.com/2020-08-30/XXXXXXXXX_original.jpg',
      is_custom_image: true,
      email: 'Mike@XXXXXXXXX',
      first_name: 'Michael',
      last_name: 'Prasuhn (he/him)',
      image_24: 'https://avatars.slack-edge.com/2020-08-30/XXXXXXXXX_24.jpg',
      image_32: 'https://avatars.slack-edge.com/2020-08-30/XXXXXXXXX_32.jpg',
      image_48: 'https://avatars.slack-edge.com/2020-08-30/XXXXXXXXX_48.jpg',
      image_72: 'https://avatars.slack-edge.com/2020-08-30/XXXXXXXXX_72.jpg',
      image_192: 'https://avatars.slack-edge.com/2020-08-30/XXXXXXXXX_192.jpg',
      image_512: 'https://avatars.slack-edge.com/2020-08-30/XXXXXXXXX_512.jpg',
      image_1024: 'https://avatars.slack-edge.com/2020-08-30/XXXXXXXXX_1024.jpg',
      status_text_canonical: '',
      team: 'XXXXXXXXX'
    },
    is_admin: false,
    is_owner: false,
    is_primary_owner: false,
    is_restricted: false,
    is_ultra_restricted: false,
    is_bot: false,
    is_app_user: false,
    updated: 1599871371,
    locale: 'en-US'
  }

Hello @mikeyp, sorry for our slow response here.

msg.envelope.user.name doesn't match anything in msg.envelope.user.slack.profile

The user.profile values are Slack's additional properties for users. envelope.user.name matches envelope.user.slack.name. id, name, real_name in user are the same with the ones at the top level of user.slack.

msg.envelope.user

{
  id: 'U111',
  name: 'seratch',
  real_name: 'Kaz',
  slack: {

msg.envelope.user.slack

{ id: 'U111',
  name: 'seratch',
  real_name: 'Kaz',
  profile: {

Let us close this issue due to inactivity. Please feel free to reopen the issue if it isn't resolved.