fix: stop noisy error alerts for expected channel_not_found#1965
Merged
fix: stop noisy error alerts for expected channel_not_found#1965
Conversation
channel_not_found is expected for deleted channels and DMs the bot cannot access. The function already returns null gracefully, but logger.error triggered the posthog bridge to post System Error notifications to the error Slack channel. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
473e3b6 to
3c97df9
Compare
Keep channelId in structured log data only, where pino serializes it safely. Interpolating user-provided values into log message strings is a log injection vector. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Slack channel IDs are alphanumeric ([A-Z0-9]+). Strip anything else to prevent log injection while still surfacing the ID for debugging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The @emnapi/core, @emnapi/wasi-threads, and tslib entries are platform-specific optional peer deps that resolve on Linux (CI) but not macOS. Removing them breaks npm ci in CI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
logger.errortologger.warningetChannelInfowhen Slack returnschannel_not_foundchannel_not_foundis expected for deleted channels and DMs the bot can't access — the function already returnsnullgracefullylogger.errorwas triggering the posthog bridge →notifySystemError→ noisy "System error: slack-client" notifications in the error channelTest plan
System error: slack-clientalerts forchannel_not_foundin production🤖 Generated with Claude Code