Skip to content

Conversation

@prabel
Copy link
Collaborator

@prabel prabel commented Nov 14, 2025

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

…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 <[email protected]>
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