Skip to content

fix(webhook): use the transport options given to send() - #2860

Open
zimeg wants to merge 2 commits into
mainfrom
zimeg/webhook-send-per-call-options
Open

zimeg wants to merge 2 commits into
mainfrom
zimeg/webhook-send-per-call-options

Conversation

@zimeg

@zimeg zimeg commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Summary

This pull request makes IncomingWebhook.send() use the fetch, timeout and retryConfig options it's given.

  • IncomingWebhookSendArguments extends the default arguments, so send({ text, fetch, timeout, retryConfig }) type-checks, but only the constructor's values were used.
  • send() now uses the values given to it for that call and falls back to the constructor's when they're left out. Following fix(webhook): strip transport options from send() payloads #2857, they're still removed from the posted payload.
  • Adds a test for each option and a patch changeset.

Follows @mwbrooks's thought on #2857, which also mentioned dropping these from IncomingWebhookSendArguments. Removing options from an exported type would break TypeScript code that passes them, so this honours them instead.

Testing

  • The three new tests fail on main and pass with this change.
  • A custom fetch given to send() is the one called.
  • With a send() timeout of 50ms and a reply delayed by 200ms, send() rejects with IncomingWebhookRequestError after about 50ms.
  • With no retryConfig on the constructor, a retryConfig given to send() retries a 503 and resolves on the next 200.

Requirements

🤖 Generated with Claude Code

Co-authored-by: Michael Brooks <21328+mwbrooks@users.noreply.github.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg
zimeg requested a review from a team as a code owner November 17, 2026 01:55
@zimeg zimeg added this to the webhook@next milestone Nov 17, 2026
@zimeg zimeg added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch pkg:webhook applies to `@slack/webhook` labels Nov 17, 2026
@zimeg zimeg self-assigned this Nov 17, 2026
@changeset-bot

changeset-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 20f820a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@slack/webhook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.35%. Comparing base (d6eb4eb) to head (20f820a).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2860      +/-   ##
==========================================
- Coverage   94.43%   94.35%   -0.09%     
==========================================
  Files          67       67              
  Lines       10809    10814       +5     
  Branches      679      681       +2     
==========================================
- Hits        10208    10204       -4     
- Misses        572      577       +5     
- Partials       29       33       +4     
Flag Coverage Δ
cli-hooks 94.30% <77.77%> (+0.03%) ⬆️
cli-test 94.30% <77.77%> (+0.03%) ⬆️
logger 94.30% <77.77%> (+0.03%) ⬆️
oauth 94.30% <77.77%> (+0.03%) ⬆️
socket-mode 94.30% <77.77%> (+0.03%) ⬆️
web-api 94.30% <77.77%> (+0.03%) ⬆️
webhook 94.30% <77.77%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg zimeg changed the title fix(webhook): use the timeout and retryConfig given to send() fix(webhook): use the transport options given to send() Nov 17, 2026

@mwbrooks mwbrooks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Appreciate the follow-up @zimeg! Honouring the send() options keeps the exported type working as written, which beats removing them.

This branch has not been deployed

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

Labels

bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented pkg:webhook applies to `@slack/webhook` semver:patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants