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

user/cm: cleanup unverified contact methods #2764

Merged
merged 17 commits into from
Mar 20, 2023

Conversation

cmarquis
Copy link
Contributor

@cmarquis cmarquis commented Dec 29, 2022

  • Identified the issue which this PR solves.
  • Read the CONTRIBUTING document.
  • Code builds clean without any errors or warnings.
  • Added appropriate tests for any new functionality.
  • All new and existing tests passed.
  • Added comments in the code, where necessary.
  • Ran make check to catch common errors. Fixed any that came up.

Description:
Unverified contact methods will be automatically removed when the verification code expires. This prevents contact methods that may have been created by mistake or were otherwise orphaned from hanging around in the system.

Which issue(s) this PR fixes:
Fixes #2727

Screenshots:
Contact Methods

Describe any introduced user-facing changes:
A UI message is displayed on unverified contact methods.

Describe any introduced API changes:
Added a pending property to the UserContactMethod.

Additional Info:

  • Added a pending field to the user_contact_methods table. When a contact method is created it is defaulted to true. Once the contact method is verified it will be set to false via a database trigger on the user_contact_methods.disabled field. This field can be used going forward to know if a contact method has been previously verified.
  • When the migration for this feature runs all existing contact methods will have the new pending value set to false therefore considering them to have been verified at some point and the system will not remove them.

@cmarquis cmarquis marked this pull request as ready for review January 3, 2023 16:03
- Refactored the migration
- Refactored the verifymanager test
KatieMSB
KatieMSB previously approved these changes Jan 11, 2023
test/smoke/verifymanager_test.go Outdated Show resolved Hide resolved
test/smoke/verifymanager_test.go Outdated Show resolved Hide resolved
test/smoke/verifymanager_test.go Outdated Show resolved Hide resolved
test/smoke/verifymanager_test.go Outdated Show resolved Hide resolved
@stale
Copy link

stale bot commented Mar 18, 2023

This pull request has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale This is inactive label Mar 18, 2023
@stale stale bot removed the stale This is inactive label Mar 20, 2023
KatieMSB
KatieMSB previously approved these changes Mar 20, 2023
KatieMSB
KatieMSB previously approved these changes Mar 20, 2023
mastercactapus
mastercactapus previously approved these changes Mar 20, 2023
@cmarquis
Copy link
Contributor Author

@mastercactapus @KatieMSB had to remake the db-schema to fix build issues.

@mastercactapus mastercactapus merged commit f65d668 into master Mar 20, 2023
@mastercactapus mastercactapus deleted the 2727-cleanup-unverified-cms branch March 20, 2023 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

user/cm: cleanup contact methods that do not get verified
3 participants