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

[ENG-4903] Fixes issue with email confirmation links failing due to database congestion #10662

Conversation

uditijmehta
Copy link
Contributor

@uditijmehta uditijmehta commented Jul 9, 2024

Purpose

Move email confirmation to a post-commit task.

Changes

  • Moved send_confirm_email call to a post-commit task in UserEmailsSerializer.
  • Defined send_confirm_email_async to handle email sending after database transactions are committed.

QA Notes

The send_confirm_email function has been refactored to send_confirm_email_async across various parts of the codebase.

  • API User Email Creation (api/users/serializers.py):
    Scenario: Adding a new email address to a user profile.

  • API User Email Resend Confirmation (api/users/views.py):
    Scenario: Resending confirmation email.

  • User Registration (framework/auth/views.py):
    Scenario: New user registration.

  • Resend Confirmation Email (framework/auth/views.py):
    Scenario: Resending a confirmation email.

  • External Login Email Handling (framework/auth/views.py):
    Scenario: Handling email submission for first-time OAuth login user.

  • Resend Confirmation Email from Profile (website/profile/views.py):
    Scenario: Resending a confirmation email from user profile.

  • Update User Profile Emails (website/profile/views.py):
    Scenario: Adding a new email to the user profile.

  • General Email Throttling:
    Scenario: Ensuring email throttling is respected.

Ticket

https://openscience.atlassian.net/browse/ENG-4903

api/users/serializers.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@cslzchen cslzchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2nd pass done 🎆 I have a suggestion for QA notes and have a question on using local functions.

framework/auth/views.py Outdated Show resolved Hide resolved
framework/auth/views.py Show resolved Hide resolved
@cslzchen cslzchen changed the title Fixes issue with email confirmation links failing due to database congestion [ENG-4903] Fixes issue with email confirmation links failing due to database congestion Jul 12, 2024
@cslzchen cslzchen changed the base branch from develop to feature/b-and-i-24-14 July 17, 2024 14:44
@cslzchen
Copy link
Collaborator

Update: changed base branch to feature/b-and-i-24-14

Copy link
Collaborator

@cslzchen cslzchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for the quick response and great QA notes.

@cslzchen cslzchen merged commit 975ddb5 into CenterForOpenScience:feature/b-and-i-24-14 Jul 17, 2024
6 checks passed
Johnetordoff pushed a commit to Johnetordoff/osf.io that referenced this pull request Aug 13, 2024
…penScience/osf.io into fix-source-tags

* 'feature/b-and-i-24-14' of https://github.com/CenterForOpenScience/osf.io:
  refactor handle_duplicate_notifications and add tests
  Shorten lines; rename script for test clarity
  fix flake8 errors
  add admin screen to manage duplicate notifications
  [ENG-2814] Allow Read-only and Read/Write contributors to view a project's draft registrations (CenterForOpenScience#10660)
  [CR][ENG-5997] merge develop into b-and-i branch (CenterForOpenScience#10691)
  add exception handling in case state doesn't change
  [ENG-4527] Fix citation to use registered date (CenterForOpenScience#10678)
  restrict state changes more and allow no-ops
  split apart change provider views from general preprint view and machine_state change viewa
  Re-add permissions changes for files on withdrawn registrations (CenterForOpenScience#10671)
  [ENG-4903] Fixes issue with email confirmation links failing due to database congestion (CenterForOpenScience#10662)

# Conflicts:
#	addons/boa/requirements.txt
#	addons/box/requirements.txt
#	addons/dataverse/requirements.txt
#	addons/dropbox/requirements.txt
#	addons/github/requirements.txt
#	addons/gitlab/requirements.txt
#	addons/mendeley/requirements.txt
#	addons/owncloud/requirements.txt
#	addons/s3/requirements.txt
#	addons/twofactor/requirements.txt
#	addons/wiki/requirements.txt
#	addons/zotero/requirements.txt
#	api/base/utils.py
#	api/users/serializers.py
#	api_tests/draft_registrations/views/test_draft_registration_list.py
#	api_tests/nodes/views/test_node_draft_registration_list.py
#	api_tests/users/views/test_user_draft_registration_list.py
#	api_tests/users/views/test_user_settings.py
#	docker-compose.yml
#	poetry.lock
#	pyproject.toml
#	requirements.txt
#	requirements/dev.txt
#	requirements/release.txt
#	tests/test_views.py
#	website/util/metrics.py
Johnetordoff pushed a commit to Johnetordoff/osf.io that referenced this pull request Aug 13, 2024
…penScience/osf.io into fix-source-tags

* 'feature/b-and-i-24-14' of https://github.com/CenterForOpenScience/osf.io:
  refactor handle_duplicate_notifications and add tests
  Shorten lines; rename script for test clarity
  fix flake8 errors
  add admin screen to manage duplicate notifications
  [ENG-2814] Allow Read-only and Read/Write contributors to view a project's draft registrations (CenterForOpenScience#10660)
  [CR][ENG-5997] merge develop into b-and-i branch (CenterForOpenScience#10691)
  add exception handling in case state doesn't change
  [ENG-4527] Fix citation to use registered date (CenterForOpenScience#10678)
  restrict state changes more and allow no-ops
  split apart change provider views from general preprint view and machine_state change viewa
  Re-add permissions changes for files on withdrawn registrations (CenterForOpenScience#10671)
  [ENG-4903] Fixes issue with email confirmation links failing due to database congestion (CenterForOpenScience#10662)

# Conflicts:
#	addons/boa/requirements.txt
#	addons/box/requirements.txt
#	addons/dataverse/requirements.txt
#	addons/dropbox/requirements.txt
#	addons/github/requirements.txt
#	addons/gitlab/requirements.txt
#	addons/mendeley/requirements.txt
#	addons/owncloud/requirements.txt
#	addons/s3/requirements.txt
#	addons/twofactor/requirements.txt
#	addons/wiki/requirements.txt
#	addons/zotero/requirements.txt
#	api/base/utils.py
#	api/users/serializers.py
#	api_tests/draft_registrations/views/test_draft_registration_list.py
#	api_tests/nodes/views/test_node_draft_registration_list.py
#	api_tests/users/views/test_user_draft_registration_list.py
#	api_tests/users/views/test_user_settings.py
#	docker-compose.yml
#	poetry.lock
#	pyproject.toml
#	requirements.txt
#	requirements/dev.txt
#	requirements/release.txt
#	tests/test_views.py
#	website/util/metrics.py
Johnetordoff pushed a commit to Johnetordoff/osf.io that referenced this pull request Aug 13, 2024
…penScience/osf.io into fix-source-tags

* 'feature/b-and-i-24-14' of https://github.com/CenterForOpenScience/osf.io:
  refactor handle_duplicate_notifications and add tests
  Shorten lines; rename script for test clarity
  fix flake8 errors
  add admin screen to manage duplicate notifications
  [ENG-2814] Allow Read-only and Read/Write contributors to view a project's draft registrations (CenterForOpenScience#10660)
  [CR][ENG-5997] merge develop into b-and-i branch (CenterForOpenScience#10691)
  add exception handling in case state doesn't change
  [ENG-4527] Fix citation to use registered date (CenterForOpenScience#10678)
  restrict state changes more and allow no-ops
  split apart change provider views from general preprint view and machine_state change viewa
  Re-add permissions changes for files on withdrawn registrations (CenterForOpenScience#10671)
  [ENG-4903] Fixes issue with email confirmation links failing due to database congestion (CenterForOpenScience#10662)

# Conflicts:
#	addons/boa/requirements.txt
#	addons/box/requirements.txt
#	addons/dataverse/requirements.txt
#	addons/dropbox/requirements.txt
#	addons/github/requirements.txt
#	addons/gitlab/requirements.txt
#	addons/mendeley/requirements.txt
#	addons/owncloud/requirements.txt
#	addons/s3/requirements.txt
#	addons/twofactor/requirements.txt
#	addons/wiki/requirements.txt
#	addons/zotero/requirements.txt
#	api/base/utils.py
#	api/users/serializers.py
#	api_tests/draft_registrations/views/test_draft_registration_list.py
#	api_tests/nodes/views/test_node_draft_registration_list.py
#	api_tests/users/views/test_user_draft_registration_list.py
#	api_tests/users/views/test_user_settings.py
#	docker-compose.yml
#	poetry.lock
#	pyproject.toml
#	requirements.txt
#	requirements/dev.txt
#	requirements/release.txt
#	tests/test_views.py
#	website/util/metrics.py
Johnetordoff pushed a commit to Johnetordoff/osf.io that referenced this pull request Aug 21, 2024
…penScience/osf.io into fix-preprint-emails

* 'feature/b-and-i-24-14' of https://github.com/CenterForOpenScience/osf.io:
  Make resubmissions more like submissions (CenterForOpenScience#10709)
  renamed files with travis in their names
  fixed case where it was more appropriate
  removed all travis mentions and replaced them with CI
  [ENG-2562] add system tags to users created via institutional sign up system (CenterForOpenScience#10696)
  refactor handle_duplicate_notifications and add tests
  Shorten lines; rename script for test clarity
  fix flake8 errors
  add admin screen to manage duplicate notifications
  [ENG-2814] Allow Read-only and Read/Write contributors to view a project's draft registrations (CenterForOpenScience#10660)
  [CR][ENG-5997] merge develop into b-and-i branch (CenterForOpenScience#10691)
  add exception handling in case state doesn't change
  [ENG-4527] Fix citation to use registered date (CenterForOpenScience#10678)
  restrict state changes more and allow no-ops
  split apart change provider views from general preprint view and machine_state change viewa
  Re-add permissions changes for files on withdrawn registrations (CenterForOpenScience#10671)
  [ENG-4903] Fixes issue with email confirmation links failing due to database congestion (CenterForOpenScience#10662)

# Conflicts:
#	osf/utils/notifications.py
#	website/templates/emails/reviews_resubmission_confirmation.html.mako
Johnetordoff pushed a commit to Johnetordoff/osf.io that referenced this pull request Aug 21, 2024
…penScience/osf.io into fix-preprint-emails

* 'feature/b-and-i-24-14' of https://github.com/CenterForOpenScience/osf.io:
  Make resubmissions more like submissions (CenterForOpenScience#10709)
  renamed files with travis in their names
  fixed case where it was more appropriate
  removed all travis mentions and replaced them with CI
  [ENG-2562] add system tags to users created via institutional sign up system (CenterForOpenScience#10696)
  refactor handle_duplicate_notifications and add tests
  Shorten lines; rename script for test clarity
  fix flake8 errors
  add admin screen to manage duplicate notifications
  [ENG-2814] Allow Read-only and Read/Write contributors to view a project's draft registrations (CenterForOpenScience#10660)
  [CR][ENG-5997] merge develop into b-and-i branch (CenterForOpenScience#10691)
  add exception handling in case state doesn't change
  [ENG-4527] Fix citation to use registered date (CenterForOpenScience#10678)
  restrict state changes more and allow no-ops
  split apart change provider views from general preprint view and machine_state change viewa
  Re-add permissions changes for files on withdrawn registrations (CenterForOpenScience#10671)
  [ENG-4903] Fixes issue with email confirmation links failing due to database congestion (CenterForOpenScience#10662)

# Conflicts:
#	osf/utils/notifications.py
#	website/templates/emails/reviews_resubmission_confirmation.html.mako
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.

2 participants