Skip to content

Conversation

@sahu-virendra-1908
Copy link

@sahu-virendra-1908 sahu-virendra-1908 commented Oct 15, 2025

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_url cannot be used when posting as a user (as_user: true) in the Slack API.
It caused the following TypeScript error:

Type 'string' is not assignable to type 'undefined'.

Fix
Removed icon_url from the payload when as_user: true is used.

File Changed

  • netlify/functions/save-discussion-background/Slack.ts
  • try {
    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

  • Style
    • Slack thread replies no longer display a custom avatar; messages will use the default icon.
    • The save dialog post in Slack no longer includes the custom avatar, aligning visuals with standard Slack presentation.

@netlify
Copy link

netlify bot commented Oct 15, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 68ffc64
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/68efdc01d0f7f700080ba02b
😎 Deploy Preview https://deploy-preview-4482--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

@github-actions github-actions bot left a 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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 15, 2025

Walkthrough

Comments 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

Cohort / File(s) Summary
Slack avatar icon removal
netlify/functions/save-discussion-background/Slack.ts
Commented out icon_url: AVATAR_URL in Slack.postReplyInThread and in Slack.openSaveDialog payloads, eliminating custom avatar usage at runtime. No other logic or exports changed.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Poem

A bunny taps the keys—so light, so keen,
Snips an icon URL from the Slacky scene.
Threads still hop, dialogs still glide,
No avatars ride this message tide.
With whiskered nods and silent flair,
The code now speaks with simpler air. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and concisely summarizes the primary change by stating that icon_url is removed when as_user=true to resolve the Slack API type error, directly reflecting the PR’s intent.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6757477 and 68ffc64.

📒 Files selected for processing (1)
  • netlify/functions/save-discussion-background/Slack.ts (1 hunks)
⏰ 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)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website
  • GitHub Check: Lighthouse CI
  • GitHub Check: Test NodeJS PR - windows-latest
  • GitHub Check: Test NodeJS PR - macos-13

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b215375) to head (68ffc64).
⚠️ Report is 4 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

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

@asyncapi-bot
Copy link
Contributor

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 37
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-4482--asyncapi-website.netlify.app/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants