-
-
Notifications
You must be signed in to change notification settings - Fork 952
fix: remove icon_url when as_user=true to resolve Slack API type error #4482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix: remove icon_url when as_user=true to resolve Slack API type error #4482
Conversation
✅ Deploy Preview for asyncapi-website ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
WalkthroughComments out Slack message payload fields setting icon_url in postReplyInThread and openSaveDialog within netlify/functions/save-discussion-background/Slack.ts, removing runtime usage of a custom avatar. No exported API signatures changed. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4482 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 778 778
Branches 144 144
=========================================
Hits 778 778 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-4482--asyncapi-website.netlify.app/ |
Description
This PR fixes a TypeScript error in
netlify/functions/save-discussion-background/Slack.ts.fix: remove icon_url from Slack postMessage to fix type error #3896
Problem
icon_urlcannot be used when posting as a user (as_user: true) in the Slack API.It caused the following TypeScript error:
Fix
Removed
icon_urlfrom the payload whenas_user: trueis used.File Changed
await slackClient.chat.postMessage({
channel: channelId,
text: message,
as_user: true,
thread_ts: threadTS,
// icon_url: AVATAR_URL,
});
Verification
TypeScript check passes (
npx tsc --noEmit)Verified Slack messages post correctly with and without custom icons.
Summary by CodeRabbit