Slack bolt built-in OAuth, what is next step after authorization?

I initialize Slack bolt app with built-in Ouath installer. Everything seems fine, I can install app with button that is generated in 'slack/install' path, the Installation is added to DB, app fetches Installation from DB and after authentication I get "Success! Redirecting to the Slack App...".

And then when I try to send Slash command or catch "app_home_opened" event nothing happens... I see that request comes to my app but nothing happens and I get

"[ERROR]  bolt-app An incoming event was not acknowledged within 3 seconds. Ensure that the ack() argument is called in a listener.". 

Commands and events work when I initialize app with my bot token (without installer).

Should I authorize somehow Installation after it fetches from DB? That's how I initialize app:

export const app = new App({
  endpoints: {
    events: '/slack/events',
    commands: '/slack/commands',
  },
  logLevel: LogLevel.DEBUG,
  signingSecret: process.env.SLACK_SIGNING_SECRET,
  clientId: process.env.SLACK_CLIENT_ID,
  clientSecret: process.env.SLACK_CLIENT_SECRET,
  stateSecret: 'secret',
  scopes: [
    'channels:read',
    'channels:history',
    'chat:write',
    'commands',
    'files:read',
    'files:write',
    'im:history',
    'im:write',
    'incoming-webhook',
    'users.profile:read',
  ],
  installationStore: {
    storeInstallation: (installation): Promise<void> => {
      //here I add to db
    },
    fetchInstallation: async (InstallQuery): Promise<Installation> => {
      //here I fetch db
    },
  },
  installerOptions: {
    authVersion: 'v2'
  },
})

1 answer

  • answered 2020-06-01 20:34 Patryk

    It seems that my fetching function had a bug.