Skip to content

fix: stop noisy error alerts for expected channel_not_found#1965

Merged
bokelley merged 5 commits intomainfrom
bokelley/slack-channel-not-found
Apr 7, 2026
Merged

fix: stop noisy error alerts for expected channel_not_found#1965
bokelley merged 5 commits intomainfrom
bokelley/slack-channel-not-found

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented Apr 6, 2026

Summary

  • Downgraded logger.error to logger.warn in getChannelInfo when Slack returns channel_not_found
  • channel_not_found is expected for deleted channels and DMs the bot can't access — the function already returns null gracefully
  • logger.error was triggering the posthog bridge → notifySystemError → noisy "System error: slack-client" notifications in the error channel

Test plan

  • All 607 unit tests pass
  • TypeScript compiles cleanly
  • Verify no more System error: slack-client alerts for channel_not_found in production

🤖 Generated with Claude Code

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>
@bokelley bokelley force-pushed the bokelley/slack-channel-not-found branch from 473e3b6 to 3c97df9 Compare April 7, 2026 08:04
bokelley and others added 3 commits April 7, 2026 04:12
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>
@bokelley bokelley merged commit 2e0e4b7 into main Apr 7, 2026
12 checks passed
@bokelley bokelley deleted the bokelley/slack-channel-not-found branch April 7, 2026 08:49
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