Comments (10)
Thanks for the report, I believe this may occur during the brief window when the app is attempting to reconnect, it will have two simultaneous websocket connections open, which may confuse the state machine, as the state machine assumes a single connection exists.
I will mark this as a bug and will try to reproduce the scenario using the integration tests.
from node-slack-sdk.
Any clue why this error: An unhandled error occurred while Bolt processed (type: undefined, error: TypeError: Cannot read properties of undefined (reading 'event'))
is happening so frequently?
It doesn't seem to directly affect anything (and I guess it only happens when there are no incoming requests), but still curious.
from node-slack-sdk.
What version of the @slack/socket-mode
package are you using?
Also, if it is possible to turn on debug logging for your app (it looks like you are using bolt? If so: instructions on how to do so here) and post debug logs, that would be helpful too.
I am not sure on the exact cause of the logs, it may also depend on any additional code you may have integrated in your bolt app. Can you post your App
initialization (and if you are using a custom receiver, the initialization of the receiver as well).
from node-slack-sdk.
I'm also seeing this trace recently. There're so many reconnection trial, and after that it always said Unhandled event 'server disconnect old socket' in state 'connecting'.
, and process crashed. I use @slack/[email protected]
without any custom receiver.
const app = new App({
signingSecret: process.env.SECRET,
token: process.env.TOKEN,
socketMode: true,
appToken: process.env.APP_TOKEN,
port: Number(process.env.PORT || 3000),
logLevel: LogLevel.INFO,
});
app.start();
from node-slack-sdk.
What version of the @slack/socket-mode package are you using?
I use @slack/[email protected]
and it installs @slack/[email protected]
.
This is my app initialization:
const app = new App({
port: parseInt(process.env.PORT || '', 10) || 6543,
socketMode: true,
token: slackSecrets?.slackBotToken,
appToken: slackSecrets?.slackAppToken,
signingSecret: slackSecrets?.slackSigningSecret,
logLevel: appLogLevel,
logger,
customRoutes: [
...getActuatorEndpoints(),
],
extendedErrorHandler: true,
});
customRoutes
has some health check related endpoints.
Noting that I do de-reference the slack secrets once the app is initialized. Let me know if this might be a problem.
from node-slack-sdk.
Noting that I do de-reference the slack secrets once the app is initialized. Let me know if this might be a problem.
That should be fine. If there are easily detectable problems with the secrets (like missing or empty values), it would be raised upon initialization.
We've had more reports from folks about problems with reconnecting and this package recently. In my investigations, it is partly due to the very old implementation in the node socket-mode package (based on a several-years-old version of the old @slack/rtm-api
module).
We are considering migrating the python-slack-sdk implementation/design to node and releasing it as the next major version.
from node-slack-sdk.
Related Issues (20)
- types: add type tests via tsd
- Web-sdk not compatible with CRA? HOT 5
- Is it possible to get typing event or indicator when a user in slack starts typing in a message HOT 2
- Typescript type error for `web.files.uploadV2()` arguments when using `file_uploads` HOT 2
- Missing exported types (Channel, etc) HOT 7
- Bun runtime support for @slack/web-api HOT 1
- Way to disable message content being logged HOT 3
- files.upload method returns warning message "files.upload may cause some issues like timeouts for relatively large files." HOT 4
- Main thread crashes due to unhandled error from @slack/web-api SDK HOT 3
- Update files.upload Documentation on Slack API Website for files.uploadV2 HOT 4
- 'process is not defined' in react vite HOT 1
- The icon_url option on chat.postMessage does not seem to affect the preview avatar image shown in the thread reply summary HOT 3
- Please support `AbortSignal` HOT 2
- Document inconsistency: checkboxes block element's description can have both plain_text and mrkdwn HOT 2
- icon_url is not working in thread replies.
- socket-mode: Type event payloads HOT 1
- web-api: Consider removing need to provide empty object as argument to zero-argument methods HOT 2
- web-api: Consider removing empty interfaces HOT 5
- sharedPublicURL rejects with error "not_allowed" for no clear reason HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-slack-sdk.