Repository navigation
Conversation
Add a logger to @slack/webhook that warns at construction time when: - IncomingWebhook receives a URL containing "/triggers/" - WebhookTrigger receives a URL containing "/services/" This helps catch misconfiguration that causes duplicate deliveries or hangs (see #654). Both classes now accept optional `logger` and `logLevel` options via their defaults/options argument. Refs: #654 Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
🦋 Changeset detectedLatest commit: 16d3538 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2688 +/- ##
==========================================
+ Coverage 94.43% 94.51% +0.07%
==========================================
Files 67 68 +1
Lines 10809 10880 +71
Branches 679 694 +15
==========================================
+ Hits 10208 10283 +75
+ Misses 572 571 -1
+ Partials 29 26 -3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
…ogger Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Keep @slack/logger beside the newer @slack/types floor from main and regenerate the lockfile. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
A logger passed in options is no longer renamed or reset to INFO. When both logger and logLevel are given, logLevel is ignored with a debug note, and the getLogger helper now matches the one in web-api. Existing option fields keep their original order, with logger and logLevel added after retryConfig. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Sets the logger after the other options and checks for an ignored logLevel in its own case. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
zimeg
marked this pull request as ready for review
November 17, 2026 00:37
mwbrooks
approved these changes
Nov 17, 2026
Co-authored-by: Michael Brooks <21328+mwbrooks@users.noreply.github.com> Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
5 tasks done
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> # Conflicts: # packages/webhook/src/IncomingWebhook.ts
Co-authored-by: Michael Brooks <21328+mwbrooks@users.noreply.github.com> Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds a logger to
@slack/webhookthat warns when a URL looks meant for the other webhook class.IncomingWebhookwarns if the URL contains/triggers/, which is likely meant forWebhookTrigger.WebhookTriggerwarns if the URL contains/services/, which is likely meant forIncomingWebhook.loggerandlogLeveloptions, with@slack/logger@^5.0.0as a new dependency likeweb-apiandsocket-mode. A givenloggeris used as-is, and alogLevelpassed with it logs a warning that it was ignored.After v4 of
slack-github-action, people sent incoming webhook URLs withwebhook-type: webhook-trigger, which caused duplicate deliveries, hangs and JSON parse errors (slackapi/slack-github-action#654, slackapi/slack-github-action#671). Those symptoms were fixed in #2674 (@slack/webhook@8.0.1). This warning flags the mismatch itself at construction time, for any consumer of the package.send()also stripsloggerandlogLevelfrom payloads, following #2857.Testing
loggeris used as-is whenlogLevelis also set.npm test --workspace=packages/webhook: 46/46 pass.npm run lint(Biome 2.6.4) is clean.npm run build --workspace=packages/webhooksucceeds.ConsoleLoggerprints the warning aswebhook:<Class>:<n>, and a customloggerkeeps its own level and name.Requirements
🤖 Generated with Claude Code