Skip to content

Bug Fix: Slack Notification Not Sent When Ticket Marked as "Done" in Notion#3

Open
aliyamuqaddas wants to merge 3 commits into
Jump-App:mainfrom
aliyamuqaddas:bug-fix
Open

Bug Fix: Slack Notification Not Sent When Ticket Marked as "Done" in Notion#3
aliyamuqaddas wants to merge 3 commits into
Jump-App:mainfrom
aliyamuqaddas:bug-fix

Conversation

@aliyamuqaddas
Copy link
Copy Markdown

@aliyamuqaddas aliyamuqaddas commented May 12, 2025

Summary

This PR fixes an issue where marking a ticket as "Done" in Notion did not trigger the expected Slack notification. The problem was due to silent failures and missing validations in the Slack notification flow.

✅ Fixes

  • post_message/2 in JumpTickets.External.Slack was returning nil for an empty channel ID, causing silent failures.
  • No validation existed to check whether a valid Slack channel ID was extracted from the channel URL.
  • The DoneNotifier module lacked proper error handling and logging, making the issue hard to trace.
  • TicketDoneController did not report specific error reasons.

🔧 Changes Made

  • Improved post_message/2:
    Returns {:error, :empty_channel_id} if the channel ID is empty.

  • Validated Slack channel ID:
    Ensures the channel ID is non-empty before sending messages.

  • Improved error handling in notify_ticket_done/3:
    Now matches and logs specific error cases (e.g., empty channel ID, invalid URL).

  • Enhanced logging and error responses in controller:
    Clearer error messages make debugging easier and improve reliability.

🧪 Testing

Manually verified the following scenarios:

  • ✅ Valid Slack channel URL → notification sent
test
  • ❌ Empty channel ID → returns {:error, :empty_channel_id}
  • ❌ Invalid Slack channel URL format → handled gracefully
  • ❌ No Slack channel provided → descriptive error logged

@aliyamuqaddas aliyamuqaddas changed the title Fixed the bug Bug Fix: Slack Notification Not Sent When Ticket Marked as "Done" in Notion May 12, 2025
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.

1 participant