bolt-js icon indicating copy to clipboard operation
bolt-js copied to clipboard

feat: add missing SocketMode options

Open misscoded opened this issue 2 months ago • 3 comments

Summary

Adds missing SocketModeOptions to App init. Resolves #2292.

New options are made available as seen below:

/** Initialization */
const app = new App({
  token: process.env.SLACK_BOT_TOKEN,
  socketMode: true,
  appToken: process.env.SLACK_APP_TOKEN,
  logLevel: LogLevel.DEBUG,
  // New SocketModeOptions 
  socketModeOptions: {
    autoReconnectEnabled: true,
    clientPingTimeout: 420,
    pingPongLoggingEnabled: true,
    serverPingTimeout: 150,
  },
});

To test:

  • [ ] Spin up TS-friendly Bolt project (https://github.com/slack-samples/bolt-ts-starter-template)
  • [ ] Symlink @slack/bolt-js to this branch in project
  • [ ] Verify that types exist
  • [ ] Verify that changing these values reflects the same changes when logging the SocketMode receiver after initialization (i.e., autoReconnectEnabled, serverPingTimeoutMS, clientPingTimeoutMS, pingPongLoggingEnabled).

Requirements (place an x in each [ ])

misscoded avatar Dec 08 '25 22:12 misscoded

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 93.46%. Comparing base (d6f9ce7) to head (ea3b4b8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2735      +/-   ##
==========================================
+ Coverage   93.44%   93.46%   +0.01%     
==========================================
  Files          37       37              
  Lines        7675     7693      +18     
  Branches      669      669              
==========================================
+ Hits         7172     7190      +18     
  Misses        498      498              
  Partials        5        5              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Dec 08 '25 22:12 codecov[bot]

Nice 💯 I also have the same question as @mwbrooks 🤔 having it in its own object could also help us with the separation of concern

WilliamBergamin avatar Dec 09 '25 14:12 WilliamBergamin

📚 Quick question if the new options might be nice to reference from this page?

🔗 https://docs.slack.dev/tools/bolt-js/concepts/socket-mode

zimeg avatar Dec 10 '25 01:12 zimeg