fix: ensure digest notification sent even when bot not in private channel - #11
Open
prabel wants to merge 1 commit into
Open
fix: ensure digest notification sent even when bot not in private channel#11prabel wants to merge 1 commit into
prabel wants to merge 1 commit into
Conversation
…nnel Fix issue where digest notification was not being sent when incident was created from a private channel where the bot is not a member. Previously, the confirmation message posting would fail with "channel_not_found" error, which would prevent the digest notification from being sent. Root Cause: - Incident created in Notion successfully - Confirmation message posting failed (bot not in private channel) - Exception bubbled up to outer catch block - Digest notification code never executed - Leadership not notified of new incident Solution: - Wrap confirmation message posting in try-catch block - Add fallback: send DM to user if channel posting fails - Make Notion update non-blocking (wrapped in try-catch) - Ensure digest notification always executes Benefits: - Digest notification ALWAYS sent when incident created - User gets helpful DM explaining bot needs to be in channel - Better error handling and logging - Incident creation fully non-blocking - No data loss or missing notifications Changes: - Add try-catch around confirmation message posting - Add DM fallback with explanatory message - Make updateNotionPageWithSlackInfo non-blocking - Add detailed logging for each error scenario - Fix TypeScript optional chaining for slackMessage.ts Tested Scenarios: - Bot in public channel: All messages sent ✅ - Bot in private channel: All messages sent ✅ - Bot NOT in private channel: Incident created, digest sent, user gets DM ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <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.
Fix issue where digest notification was not being sent when incident was created from a private channel where the bot is not a member. Previously, the confirmation message posting would fail with "channel_not_found" error, which would prevent the digest notification from being sent.
Root Cause:
Solution:
Benefits:
Changes:
Tested Scenarios:
🤖 Generated with Claude Code