Fix @oauth2 Slack mention for non-Slack help signups#210
Merged
Conversation
When a volunteer signs up to help on a project via a non-Slack login (e.g. Google), save_helping_status_old rendered a broken "@oauth2" mention in the project Slack channel because it naively split the OAuth user ID on "-". Now it uses is_slack_user_id/extract_slack_user_id, falls back to the user's display name for non-Slack logins, skips the Slack channel auto-invite for them, and emails them a Slack join CTA pointing at slack.ohack.dev so the project team can still reach them. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
save_helping_status_oldwas splitting the OAuth user ID on-and blindly wrapping it in<@...>. For Gmail IDs likeoauth2|google-oauth2|<sub>, Slack interpreted the|as mention-label syntax and rendered the literal text "@oauth2".is_slack_user_id/extract_slack_user_idfromcommon/utils/oauth_providers.py. Slack users keep today's behavior (<@Uxxx>mention + auto-invite to the project channel). Non-Slack users fall back touser.nameas plain text in the Slack post, and the channel auto-invite is skipped (it would 400 on an invalid Slack ID).helpingsignup, sends a follow-up email via Resend thanking the volunteer and asking them to join the workspace at https://slack.ohack.dev so the project team can actually reach them. Failures are swallowed so a Resend outage never breaks the help toggle.Files changed
api/messages/messages_service.py—save_helping_status_oldOAuth branchingservices/email_service.py— newsend_project_help_slack_invite_emailWhy not migrate the endpoint to the newer
save_helping_status?services/problem_statements_service.py:save_helping_statusalready branches onis_slack_user_id, but it silently skips the Slack post entirely for non-Slack users. Switching endpoints would regress project-team visibility. Smaller-blast-radius fix here; consolidation is follow-up work.Test plan
<@Uxxx>mention and user is invited to the project channel. No email sent.@oauth2); user receives the "Join Slack" email; noinvite_user_to_channelcall / no Slack 400 in logs.RESEND_WELCOME_EMAIL_KEY) and repeat the Google flow → Slack post still goes out; endpoint still returns 200.🤖 Generated with Claude Code