Merged
Conversation
User deletion: - Delete user_social_accounts before user to avoid NOT NULL violation - Block delete when user is org owner; return error with org names and ask to transfer ownership - Delete organization_members (and group_members) for user before delete to avoid FK violation OAuth/social login: - Update existing user full_name and avatar_url from provider on social login - Apply same update when linking social account to existing user by email
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.
Description
Fixes for user deletion and profile sync on social login:
User deletion
user_social_accountsbefore deleting the user (avoids NOT NULL violation onuser_id).organization_members.Social login (OAuth)
full_nameandavatar_urlfrom provider data when:Tests
User.uuid(string →uuid.UUID) inbefore_flushfor SQLite sotest_delete_user_successpasses when acommit()runs in the middle of the delete flow.Related Issue
Closes #
Type of Change
Component Affected
Checklist
General
Testing
Documentation
Screenshots (if applicable)
N/A
Test Plan
DELETE /users/{uuid}(admin); user without org and without social accounts is removed successfully.full_nameandavatar_urlare updated on the user (and in/auth/me).make api-testand confirm all 365 tests pass (includingtest_delete_user_success).Additional Notes
UserIsOrganizationOwnerError(inuser_validators); use ofOrganizationMemberRepository.delete_by_user_idandUserSocialAccountRepository.delete_by_user_id.AttributeError: 'str' object has no attribute 'hex'on flush duringcommit()insidedelete_by_user_id.