fix: add users to managed event types when auto-accepting sub-team memberships#24392
fix: add users to managed event types when auto-accepting sub-team memberships#24392joeauyeung wants to merge 3 commits intomainfrom
Conversation
…mberships When a user is auto-accepted to a parent organization, their pending sub-team memberships are batch-accepted, but updateNewTeamMemberEventTypes was never called for those sub teams. This caused users to not be added to managed event types with assignAllTeamMembers: true. This fix queries for pending sub-team memberships before accepting them, then calls updateNewTeamMemberEventTypes for each newly-accepted sub team to ensure users are properly added to managed event types. Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
…ment Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
|
This PR is being marked as stale due to inactivity. |
|
Closing in favour of #24731 (review) |
What does this PR do?
Fixes a bug where users auto-accepted to sub teams via domain matching were not being automatically added to managed event types with
assignAllTeamMembers: true.Root Cause: The invitation flow was missing calls to
updateNewTeamMemberEventTypesin two scenarios:Solution: Added the missing
updateNewTeamMemberEventTypescalls in both code paths to ensure users get properly assigned to managed event types.Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Integration Tests: Added comprehensive integration tests that verify both scenarios work correctly. The tests:
assignAllTeamMembers: trueManual Testing (if needed):
orgAutoAcceptEmaildomain matchingassignAllTeamMembers: true)Key Changes
Bug Fix #1: Existing users auto-accepted to org
Bug Fix #2: New users invited to sub-team
Review Focus Areas
orgConnectInfoByUsernameOrEmail[user.email].autoAcceptworks correctlyLink to Devin run: https://app.devin.ai/sessions/c0d0a43edbe6412dbec727ffd00e1e6f
Requested by: @joeauyeung