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

patch: send email async #71

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

lakshay-saini-au8
Copy link
Contributor

@lakshay-saini-au8 lakshay-saini-au8 commented Jan 3, 2024

Type

bug_fix


Description

This PR addresses a bug related to the email sending operations in the application. Previously, these operations were performed synchronously, which could potentially block the execution of the application. The changes in this PR make these operations asynchronous, improving the application's performance and responsiveness. The affected operations include:

  • Sending OTP for login
  • Sending project invitation emails for non-registered users
  • Sending general emails

PR changes walkthrough

Relevant files                                                                                                                                 
Bug fix
2 files
auth.service.ts                                                                                         
    apps/api/src/auth/service/auth.service.ts

    The await keyword was removed from the
    this.resend.sendOtp(email, otp.code) call, making the OTP
    sending operation asynchronous.

+1/-1
mail.service.ts                                                                                         
    apps/api/src/mail/services/mail.service.ts

    The await keyword was removed from multiple
    this.sendEmail(email, subject, body) calls, making the
    email sending operations asynchronous.

+4/-4

User description

Description

Remove await to send all the email async

Fixes #63

Dependencies

Mention any dependencies/packages used

Future Improvements

Mention any improvements to be done in future related to any file/feature

Mentions

@rajdip-b

Screenshots of relevant screens

Add screenshots of relevant screens

Developer's checklist

  • My PR follows the style guidelines of this project
  • I have performed a self-check on my work

If changes are made in the code:

  • I have followed the coding guidelines
  • My changes in code generate no new warnings
  • My changes are breaking another fix/feature of the project
  • I have added test cases to show that my feature works
  • I have added relevant screenshots in my PR
  • There are no UI/UX issues

Documentation Update

  • This PR requires an update to the documentation at docs.keyshade.xyz
  • I have made the necessary updates to the documentation, or no documentation changes are required.

Copy link
Contributor

PR Description updated to latest commit (728256d)

@lakshay-saini-au8
Copy link
Contributor Author

@rajdip-b Please Review

Copy link
Contributor

PR Analysis

  • 🎯 Main theme: Making email sending operations asynchronous
  • 📝 PR summary: This PR addresses a bug where email sending operations were performed synchronously, potentially blocking the execution of the application. The changes in this PR make these operations asynchronous, improving the application's performance and responsiveness.
  • 📌 Type of PR: Bug fix
  • 🧪 Relevant tests added: No
  • ⏱️ Estimated effort to review [1-5]: 1, because the changes are straightforward and involve only the removal of the 'await' keyword to make the email sending operations asynchronous.
  • 🔒 Security concerns: No security concerns found

PR Feedback

💡 General suggestions: It's great that you've identified the need to make email sending operations asynchronous. This should improve the application's performance and responsiveness. However, it would be beneficial to add error handling for these asynchronous operations to ensure that any failures are properly handled and logged.

🤖 Code feedback:
relevant fileapps/api/src/auth/service/auth.service.ts
suggestion      

Consider adding a .catch() block to handle any errors that may occur during the asynchronous operation. This could help in logging and debugging any issues that might arise. [important]

relevant linethis.resend.sendOtp(email, otp.code)

relevant fileapps/api/src/mail/services/mail.service.ts
suggestion      

Similar to the previous suggestion, consider adding a .catch() block to handle any errors that may occur during the asynchronous operation. This could help in logging and debugging any issues that might arise. [important]

relevant linethis.sendEmail(email, subject, body)

✨ Usage tips:

To invoke the PR-Agent, add a comment using one of the following commands:

  • /review: Request a review of your Pull Request.
  • /describe: Update the PR title and description based on the contents of the PR.
  • /improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
  • /ask <QUESTION>: Ask a question about the PR.
  • /update_changelog: Update the changelog based on the PR's contents.
  • /add_docs 💎: Generate docstring for new components introduced in the PR.
  • /generate_labels 💎: Generate labels for the PR based on the PR's contents.
  • /analyze 💎: Automatically analyzes the PR, and presents changes walkthrough for each component.

See the tools guide for more details.
To edit any configuration parameter from the configuration.toml, add --config_path=new_value.
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, add a /config comment.

@rajdip-b rajdip-b changed the title bug: send email async patch: send email async Jan 3, 2024
@rajdip-b rajdip-b merged commit 091e49b into keyshade-xyz:main Jan 3, 2024
1 of 7 checks passed
@rajdip-b
Copy link
Member

rajdip-b commented Feb 2, 2024

🎉 This PR is included in version 1.0.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@rajdip-b
Copy link
Member

rajdip-b commented Feb 9, 2024

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

Remove all await keywords from infront of mailing functions
2 participants