Summary
The Slack bot attempts to invite users to channels it is not a member of, resulting in a not_in_channel API error. The bot should either verify it's in the target channel before attempting an invite, or gracefully handle the error.
Steps to Reproduce
- Bot attempts to invite user
U09QCL9HURE to channel C09HEERCY8P
- Slack API returns
not_in_channel error
- Operation fails silently with no fallback
Proposed Fix
Two-part fix:
- Code fix: Before inviting a user to a channel, check if the bot is a member. If not, skip the invite and log a warning rather than erroring.
- Infra fix: Audit all channels the bot should be in and ensure it's invited to each one. Add the bot to
C09HEERCY8P as an immediate mitigation.
Related
Summary
The Slack bot attempts to invite users to channels it is not a member of, resulting in a
not_in_channelAPI error. The bot should either verify it's in the target channel before attempting an invite, or gracefully handle the error.Steps to Reproduce
U09QCL9HUREto channelC09HEERCY8Pnot_in_channelerrorProposed Fix
Two-part fix:
C09HEERCY8Pas an immediate mitigation.Related