Skip to content

fix: remove incompatible icon_url from Slack postReplyInThread#5297

Open
cairon-ab wants to merge 2 commits into
asyncapi:masterfrom
cairon-ab:fix/slack-type-error
Open

fix: remove incompatible icon_url from Slack postReplyInThread#5297
cairon-ab wants to merge 2 commits into
asyncapi:masterfrom
cairon-ab:fix/slack-type-error

Conversation

@cairon-ab

@cairon-ab cairon-ab commented Mar 30, 2026

Copy link
Copy Markdown

Description

Fixes the TypeScript type error in the postReplyInThread method in Slack.ts.

Problem

When as_user: true is set in the Slack chat.postMessage call, the icon_url property is typed as undefined by the @slack/web-api types. This is because when posting as the authenticated user, Slack automatically uses the user's profile picture — a custom icon_url is not allowed.

This causes the following TypeScript compilation error:

Argument of type '{ channel: string; text: string; as_user: true; thread_ts: string; icon_url: string; }' is not assignable to parameter of type 'ChatPostMessageArguments'.
  Types of property 'icon_url' are incompatible.
    Type 'string' is not assignable to type 'undefined'.

Fix

  • Removed the icon_url: AVATAR_URL property from the postMessage call in postReplyInThread
  • Removed the now-unused AVATAR_URL constant

The message will be posted using the authenticated user's profile picture, which is the correct behavior when as_user: true is set.

Related issue(s)

Fixes #3895

Summary by CodeRabbit

  • Bug Fixes
    • Slack thread messages will no longer display custom avatar icons; they will use the default workspace avatar instead.

@netlify

netlify Bot commented Mar 30, 2026

Copy link
Copy Markdown

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6cdb0d2
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/69d5a07c31e3cc000827ae37
😎 Deploy Preview https://deploy-preview-5297--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.

@coderabbitai

coderabbitai Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d791aa8d-eb6a-4f16-9d5b-33f55e6945d8

📥 Commits

Reviewing files that changed from the base of the PR and between 2ec7552 and 20c5749.

📒 Files selected for processing (1)
  • netlify/functions/save-discussion-background/Slack.ts
💤 Files with no reviewable changes (1)
  • netlify/functions/save-discussion-background/Slack.ts

📝 Walkthrough

Walkthrough

The pull request removes the AVATAR_URL module-level constant and stops passing the icon_url parameter in the Slack API call within the postReplyInThread method, resolving a TypeScript type incompatibility when posting messages with as_user: true.

Changes

Cohort / File(s) Summary
Slack API Type Fix
netlify/functions/save-discussion-background/Slack.ts
Removed AVATAR_URL constant and icon_url parameter from the slackClient.chat.postMessage payload to resolve TypeScript type error when using as_user: true.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A type error was haunting the code,
With icon_url on the wrong road,
When as_user says true, it must stand alone,
No custom icons, just the user's own!
Two lines removed, the error's been sown,
Clean compilation—a rabbit's delight! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing an incompatible icon_url from the Slack postReplyInThread method to fix a TypeScript type error.
Linked Issues check ✅ Passed The pull request directly addresses all coding objectives from issue #3895: removing the incompatible icon_url and AVATAR_URL constant to resolve the TypeScript error and restore successful compilation.
Out of Scope Changes check ✅ Passed The changes are narrowly scoped to the specific issue: only the AVATAR_URL constant removal and icon_url deletion from postReplyInThread, with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

codecov Bot commented Mar 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (278f84d) to head (6cdb0d2).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #5297   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines          830       830           
  Branches       159       159           
=========================================
  Hits           830       830           

☔ 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

asyncapi-bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

⚡️ Lighthouse report for the changes in this PR:

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

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

@animeshk923

Copy link
Copy Markdown
Contributor

@cairon-ab Please kindly wait till the referenced issue has been approved/triaged by one of he maintainers. Thank you for your understanding.

@sonarqubecloud

sonarqubecloud Bot commented Apr 8, 2026

Copy link
Copy Markdown

@cairon-ab

Copy link
Copy Markdown
Author

Hi — just checking in. The linked issue #3895 is labeled as a bug and this is a two-line fix (removes the incompatible icon_url when as_user is set). All CI checks pass including coverage at 100%. Would a maintainer be able to review? Thanks.

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

Labels

None yet

Projects

Status: To Be Triaged

Development

Successfully merging this pull request may close these issues.

[BUG] Fix Type Error in Slack postReplyInThread Method

3 participants