-
Notifications
You must be signed in to change notification settings - Fork 18
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/issue 4476 #1779
base: staging
Are you sure you want to change the base?
Feat/issue 4476 #1779
Conversation
WalkthroughThis update introduces a comprehensive set of changes aimed at enhancing email verification processes within the application. Key modifications include the addition of email verification columns in the user database, implementation of new methods in notification adapters, and the introduction of mutations for sending and verifying email codes. Additional enhancements involve the expansion of error messages and localization support, along with testing improvements to ensure functionality related to user email verification. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UserResolver
participant NotificationCenterAdapter
participant NotificationService
User->>UserResolver: Request email confirmation code
UserResolver->>NotificationCenterAdapter: Send email confirmation code
NotificationCenterAdapter->>NotificationService: Trigger email sending
NotificationService-->>NotificationCenterAdapter: Email sent confirmation
NotificationCenterAdapter-->>UserResolver: Confirmation sent response
UserResolver-->>User: Respond with success message
Recent review detailsConfiguration used: CodeRabbit UI Files ignored due to path filters (1)
Files selected for processing (15)
Additional comments not posted (21)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (4)
src/adapters/notifications/MockNotificationAdapter.ts (1)
38-44
: Consider implementing thesendEmailConfirmationCodeFlow
method.The method currently only logs the invocation and resolves with
undefined
, which is expected for a mock adapter. However, consider implementing actual logic or simulating behavior for testing purposes.src/resolvers/userResolver.ts (2)
271-290
: Consider logging successful email verification inverifyUserEmailCode
.Adding a log statement after successful email verification can help in tracking user actions and debugging.
user.verificationCode = null; + logger.info(`User ${user.id} successfully verified their email.`); await user.save();
292-309
: Consider improving error messages incheckEmailAvailability
.The error message for an already used email could be more descriptive, indicating the email is already verified and cannot be reused.
if (!!isEmailAlreadyUsed && isEmailAlreadyUsed.isEmailVerified) - throw new Error(i18n.__(translationErrorMessagesKeys.EMAIL_ALREADY_USED)); + throw new Error(i18n.__('The email is already verified and cannot be reused.'));src/resolvers/userResolver.test.ts (1)
1015-1042
: Clarify test description for already verified email.The test description "should fail send the email when email is already verified" could be more descriptive. Consider specifying that the test checks for an error message when attempting to resend a confirmation code to an already verified email.
- it('should fail send the email when email is already verified', async () => { + it('should return an error when trying to resend confirmation code to an already verified email', async () => {
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests