-
Notifications
You must be signed in to change notification settings - Fork 52
Description
Which area(s) of Podkrepi.bg are affected? (leave empty if unsure)
No response
Describe the Bug
Currently if too many donations come very fast, due to the lack of safe synchronization, we will send multiple email notifications.
We rely on the database to check if such a notification was already sent.
We don't have that many donations at the moment, but still.
This can become potentially a problem in the light of the automated b2b donations.
There we can expect that many small donations will arrive very often.
My best guess here is that we need to use the PostgreSQL transactions for that. And raise an event only if it was the current donation that moved the needle above the threshold.
To Reproduce
I assume we can reproduce this even with a unit test.
Expected Behavior
Should send only 1 notification when the raised amount goes above the thresholds (of 50%, 90%, or 100%)
Which browser are you using? (if relevant)
No response