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

Suppression calculated incorrectly #1238

Open
dragoangel opened this issue Oct 19, 2020 · 1 comment
Open

Suppression calculated incorrectly #1238

dragoangel opened this issue Oct 19, 2020 · 1 comment
Labels

Comments

@dragoangel
Copy link
Contributor

If you send 2 emails at once to one user, both of them has hard fails they will be counted separately, this maybe fine, but when one failed email in queue added email to suppression, second will still try to be delivered without checking that this mail already in suppression list and also after N fails will add same email second time to same suppression list.

@catphish
Copy link
Contributor

If duplicate entries are occurring then it is because this code is being executed twice at near enough the same time.
https://github.com/postalserver/postal/blob/main/lib/postal/message_db/suppression_list.rb#L9..L17
If this isn't enough to prevent duplicates then the SELECT+INSERT in this method to be changed to an INSERT … ON DUPLICATE KEY UPDATE command. This will require a unique index to be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants