Skip to content

feat(nimbus): Handle emojis added reaction#14927

Merged
yashikakhurana merged 2 commits intomainfrom
14921
Mar 17, 2026
Merged

feat(nimbus): Handle emojis added reaction#14927
yashikakhurana merged 2 commits intomainfrom
14921

Conversation

@yashikakhurana
Copy link
Contributor

Because

In production, the enrollment ending notification was failing with a Slack API error already has that reaction.

The root cause is that send_threaded_success_message() is being called multiple times for the same enrollment ending request - either due to Kinto syncs running multiple times, task retries, or periodic checks. Each time it's called, it attempts to add the white_check_mark reaction to the original message. On subsequent calls, the reaction already exists, causing the API to reject the request with already_reacted.

Previously, any Slack API error (including already_reacted) was treated as a fatal failure, logging the error and returning False. This caused the entire notification flow to fail, even though the actual desired state (the message exists and the reaction is on it) was already achieved.

This commit

Adds graceful error handling for the already_reacted Slack error. When reactions_add fails with already_reacted, the error is caught and ignored since the desired end state is already met - the reaction exists on the message. Other Slack API errors are still re-raised and properly logged as failures.

Additionally, this commit adds the underlying support for enrollment ending and experiment ending request notifications with dedicated alert types (END_ENROLLMENT_REQUEST and END_EXPERIMENT_REQUEST), consolidates duplicate Slack notification logic, and adds comprehensive tests to verify the fix works correctly.

Fixes #14921

Copy link
Collaborator

@jaredlockhart jaredlockhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect ty 🙏

@yashikakhurana yashikakhurana added this pull request to the merge queue Mar 17, 2026
Merged via the queue into main with commit bfc78e5 Mar 17, 2026
18 checks passed
@yashikakhurana yashikakhurana deleted the 14921 branch March 17, 2026 19:03
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.

enrollment ending notification failed: The request to the Slack API failed. (url: https://slack.com/api/reactions.add)

2 participants