Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Creation of a rake task to delete duplicated half signup users #651

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

AyakorK
Copy link
Contributor

@AyakorK AyakorK commented Dec 26, 2024

🎩 Description

This PR adds a rake task that will delete duplicated half signup users, and alert the administrator about the decidim accounts that contains a phone number that might be duplicated in the DB (multiple decidim accounts with the same phone number)

Testing

Describe the best way to test or validate your PR.

You might need to update manually your DB except if you have a dump that has the bug inside of it

  • Generate your App

  • Access to the db generated with your application

  • Access the table decidim-users

  • Target a dozen of users that you can easily update (that were not already deleted or blocked on the organization)

  • For a multiple case scenarios I would recommend to change 6 users to match the "quick_auth" regex email and to let 6 decidim users with "classic" emails

  • For 3 of each, add an identical phone_number with an identical phone_country

  • For 1 of each, add an identical phone_number with a different phone_country

  • For 2 of each, add a different phone number (different for each of them) regardless the phone_country

  • Make sure that when you execute the rake task bundle exec rake decidim:clear_duplicated_user that you have every logs in your stdout

  • If you followed the test scenario above :

  • Every quick_auth with the same phone_number and same phone_country should have been deleted.

  • Decidim users with the same phone_number and same phone_country should have been alerted to you with the last stdout

  • Users with an identical phone_number with a different phone_country should not have been alerted to you

  • Users with a different phone_number should not have been alerted to you

Tasks

  • Add specs
  • Create a job that will soft-delete quick_auth half signup accounts and alert about duplicated phone_numbers on decidim accounts if their phone number is duplicated through the DB
  • Create a task to execute the new job

@AyakorK AyakorK marked this pull request as ready for review December 30, 2024 09:18
@AyakorK AyakorK marked this pull request as draft December 30, 2024 09:19
@AyakorK AyakorK marked this pull request as ready for review January 3, 2025 15:52
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