Comments (8)
How are you configuring your App? What receiver are you using?
from bolt-js.
This is my App configuration:
const app = new App({
signingSecret: process.env.SLACK_SIGNING_SECRET || '',
authorize,
receiver,
logger: {
debug: (msg, ...args) => logger.debug(msg, ...args),
info: (msg, ...args) => logger.info(msg, ...args),
warn: (msg, ...args) => logger.warn(msg, ...args),
error: (msg, ...args) => logger.error(msg, ...args),
setLevel: (level) => logger.level = level,
getLevel: () => logger.level as LogLevel, // Explicitly cast logger.level to LogLevel
setName: (name) => { /* optional, implement if needed */ },
},
logLevel: process.env.LOGGER_LEVEL as LogLevel || 'info' as LogLevel,
});
Where authorize is the function on my original post. Here is my receiver:
const receiver = new ExpressReceiver({
signingSecret: process.env.SLACK_SIGNING_SECRET || '',
authorize,
});
from bolt-js.
What log level do you have set in production? Will you get WARN
level events in your logs?
I ask because if your authorize function raises an exception, that should be visible in the logs (see the code here). I am wondering if that is what is happening in this situation (but we don't know because perhaps the log level is only set to ERROR).
If you're not seeing this warning, then that means the exception may not be coming from your authorize function but from somewhere else.
from bolt-js.
I have setup info on my log level for production. What I managed to realized locally is that the error is coming from the user_change event. It happens when there is not a matching authorization, the user_change event is being triggered anyway if this context is usefull. This is an example of a debug log I get:
{
"token": "hGu1oUNhhu8oq3XFo5v773Pz",
"team_id": "T0209NJETN0",
"api_app_id": "A01KJ042JS3",
"event": {
"user": {
"id": "U02EFD8C810",
"team_id": "T02ECCVARLM",
"name": "akhil",
"color": "9f69e7",
"is_bot": false,
"is_app_user": false,
"profile": {
"avatar_hash": "5feac9543e5d",
"image_original": "https://avatars.slack-edge.com/2022-10-20/4277252194432_5feac9543e5d6344db57_original.jpg",
"image_24": "https://avatars.slack-edge.com/2022-10-20/4277252194432_5feac9543e5d6344db57_24.jpg",
"image_32": "https://avatars.slack-edge.com/2022-10-20/4277252194432_5feac9543e5d6344db57_32.jpg",
"image_48": "https://avatars.slack-edge.com/2022-10-20/4277252194432_5feac9543e5d6344db57_48.jpg",
"image_72": "https://avatars.slack-edge.com/2022-10-20/4277252194432_5feac9543e5d6344db57_72.jpg",
"image_192": "https://avatars.slack-edge.com/2022-10-20/4277252194432_5feac9543e5d6344db57_192.jpg",
"image_512": "https://avatars.slack-edge.com/2022-10-20/4277252194432_5feac9543e5d6344db57_512.jpg",
"image_1024": "https://avatars.slack-edge.com/2022-10-20/4277252194432_5feac9543e5d6344db57_1024.jpg",
"first_name": "Akhil",
"last_name": "",
"real_name": "Akhil",
"display_name": "",
"real_name_normalized": "Akhil",
"display_name_normalized": "",
"email": "[email protected]",
"team": "T02ECCVARLM"
},
"updated": 1713452477,
"who_can_share_contact_card": "EVERYONE"
},
"cache_ts": 1713452477,
"type": "user_change",
"event_ts": "1713452501.284700"
},
"type": "event_callback",
"event_id": "Ev0707SUEK7S",
"event_time": 1713452501,
"authorizations": [
{
"enterprise_id": null,
"team_id": "T0209NJETN0",
"user_id": "U056B2Q37R8",
"is_bot": true,
"is_enterprise_install": false
}
],
"is_ext_shared_channel": false
}
from bolt-js.
Can you set log level to DEBUG to help us figure out where the error is coming from?
from bolt-js.
I'm also confused: if your authorize function is raising an exception when the user_change
event comes in, I would expect that to create a WARN log in your logs (as per this line). If that's not happening, then that means your authorize
function is NOT raising an exception in this situation.
from bolt-js.
👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.
from bolt-js.
As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.
from bolt-js.
Related Issues (20)
- Cannot access the files in the "app_mention" event with TypeScript HOT 3
- How to get search params in custom routes HOT 4
- appToken is not read in socketMode @3.18.0 HOT 4
- Links with ampersand do not work in Slack iOS app HOT 6
- Add flag to `AwsLambdaReceiver` to disable Signature Verification HOT 1
- Events Subscription is continuously being turned off when we kill the process HOT 4
- Add reply_in_thread method HOT 1
- Run multiple replicas in k8s of bot app HOT 1
- Frequent disconnects in socket mode HOT 9
- Unable to upload a file in a direct message using files.completeUploadExternal HOT 5
- `too_many_websockets` causes Cannot read properties of undefined (reading 'event') HOT 5
- Cannot respond to incoming message events with `say` using the Bun runtime HOT 4
- Keep getting Error: Cannot write headers after they are sent to the client HOT 3
- How do I create a custom ConsoleLogger? HOT 1
- Better typing for block actions payload HOT 3
- How to access Company ID during OAuth for Slack App Installation HOT 2
- Add docs/sample for using browser cookies to pass custom app data during OAuth flow
- chat.postMessage returns channel name in the response HOT 4
- How do i update "messages_tab_read_only_enabled" to true/false programmatically HOT 1
- Update Ruby version for documentation generation (2.7.6 is end-of-life) HOT 1
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 bolt-js.