Skip to content

refactor: clean up slack notifcation for signups#817

Open
rohan-chaturvedi wants to merge 2 commits intomainfrom
fix--slack-signup-notifs
Open

refactor: clean up slack notifcation for signups#817
rohan-chaturvedi wants to merge 2 commits intomainfrom
fix--slack-signup-notifs

Conversation

@rohan-chaturvedi
Copy link
Member

Summary

  • Fixed duplicate Slack notifications firing for the same email on new user signups
  • Root cause: notify_slack() was called inside each OAuth adapter's complete_login(), which runs before allauth creates the CustomUser. If the request failed after the notification but before user creation was committed, the user would retry and trigger another notification since the user still didn't exist.
  • Moved the notification to allauth's user_signed_up signal, which fires only once, after the user is confirmed created in the database.

Changes

  • Added backend/api/signals.py with a user_signed_up signal handler for Slack notifications
  • Registered the signal in backend/api/config.py (APIConfig.ready())
  • Removed notify_slack calls and related imports from all three OAuth adapters (Google, GitHub, GitLab)

Test plan

  • Sign up with a new Google account → verify single Slack notification with full name
  • Sign up with a new GitHub account → verify single Slack notification
  • Sign up with a new GitLab account → verify single Slack notification
  • Sign in with an existing account → verify no Slack notification
  • Verify login emails still send correctly on every login

Signed-off-by: rohan <rohan.chaturvedi@protonmail.com>
Signed-off-by: rohan <rohan.chaturvedi@protonmail.com>
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