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

Filter unique pending notifications to avoid duplicate emails #2459

Conversation

pdcp1
Copy link
Collaborator

@pdcp1 pdcp1 commented Nov 30, 2023

This PR solved the problem of sending duplicated emails to the same user. Issue: #2404

  • We add a filter to the recipient list to avoid duplicated recipients for the same email.

Testing notes

Preview link https://deploy-preview-32--pablocosta-staging.netlify.app/
Note that in order to trigger the process notification function it should be triggered manually from Pablo's Atlas account.

Note

We still have an issue in the origin of the actual bug that inserts multiple pending notifications and subscriptions for the same user. But this can be treated in another PR.

Duplicated pending notifications in Production:

image

Duplicated subscriptions in Production:

image

pdcp1 and others added 6 commits November 15, 2023 20:05
…borative#2372)

* Remove duplicated query and limit users to 9999

* Trigger deploy

* Fix map of editors

* Fix admin test to use mock

* Add missing users to. mock

* Fix users list

* Fix user selection on userfields dropdown
Copy link

netlify bot commented Nov 30, 2023

Deploy Preview for staging-aiid ready!

Name Link
🔨 Latest commit 261274b
🔍 Latest deploy log https://app.netlify.com/sites/staging-aiid/deploys/65821156c2d94f000873fdd4
😎 Deploy Preview https://deploy-preview-2459--staging-aiid.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@pdcp1 pdcp1 self-assigned this Nov 30, 2023
@pdcp1 pdcp1 changed the title Filter unique recipients to avoid duplicate emails Filter unique pending notifications to avoid duplicate emails Dec 5, 2023
@pdcp1 pdcp1 marked this pull request as ready for review December 5, 2023 22:05
@pdcp1 pdcp1 requested a review from cesarvarela December 5, 2023 22:21
Copy link
Collaborator

@cesarvarela cesarvarela left a comment

Choose a reason for hiding this comment

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

Can you add a test that has duplicated subscriptions/notifications and makes sure the emails are not sent multiple times?

@pdcp1
Copy link
Collaborator Author

pdcp1 commented Dec 14, 2023

Can you add a test that has duplicated subscriptions/notifications and makes sure the emails are not sent multiple times?

@cesarvarela done! please review

@kepae kepae merged commit b1a4672 into responsible-ai-collaborative:staging Dec 21, 2023
4 checks passed
@pdcp1 pdcp1 deleted the fix/send-duplicated-notifications branch December 21, 2023 21:47
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.

4 participants