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

Send verification email in async task #268

Merged
merged 4 commits into from Mar 3, 2023
Merged

Send verification email in async task #268

merged 4 commits into from Mar 3, 2023

Conversation

pdeziel
Copy link
Contributor

@pdeziel pdeziel commented Mar 2, 2023

Scope of changes

This updates the Quarterdeck register endpoint so that we're not blocked waiting for emails to send after the user has been created in the database.

Fixes SC-14589

Type of change

  • new feature
  • bug fix
  • documentation
  • testing
  • technical debt
  • other (describe)

Acceptance criteria

Describe how reviewers can test this change to be sure that it works correctly. Add a checklist if possible.

Author checklist

  • I have manually tested the change and/or added automation in the form of unit tests or integration tests
  • I have updated the dependencies list
  • I have recompiled and included new protocol buffers to reflect changes I made
  • I have added new test fixtures as needed to support added tests
  • Check this box if a reviewer can merge this pull request after approval (leave it unchecked if you want to do it yourself)
  • I have moved the associated Shortcut story to "Ready for Review"

Reviewer(s) checklist

  • Any new user-facing content that has been added for this PR has been QA'ed to ensure correct grammar, spelling, and understandability.
  • Are there any TODOs in this PR that should be turned into stories?

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #14589: Create task to resend email on failure.

@@ -347,7 +347,7 @@ func (s *Server) TenantStats(c *gin.Context) {
Count: int64(totalKeys),
},
{
Name: "usage_kbytes",
Name: "storage",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Request from @masskoder

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably if we're going to change this we should make the usage a string with the units in the string rather than a number. We can follow up on that later though.

@@ -116,6 +117,7 @@ func (s *quarterdeckTestSuite) TestRegister() {
s.CheckError(err, http.StatusConflict, "user or organization already exists")

// Test that one verify email was sent to each user
s.StopTasks()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this should avoid the race condition for now, let me know if there's a more delicate way to wait for the current tasks to stop without having to reset the entire task manager.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I didn't think about race conditions with respect to the tests. You're right that this is a pretty tricky situation.

@pdeziel pdeziel requested a review from bbengfort March 2, 2023 20:01
Copy link
Contributor

@bbengfort bbengfort left a comment

Choose a reason for hiding this comment

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

Thank you for putting this together so quickly! I'll merge and deploy as soon as the tests pass.

@bbengfort bbengfort merged commit 6b54f34 into main Mar 3, 2023
@bbengfort bbengfort deleted the sc-14589 branch March 3, 2023 12:36
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.

None yet

2 participants