summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2019-05-16 12:17:01 +0000
committerDenis Ledoux <dle@odoo.com>2019-05-16 12:57:57 +0000
commit272359b86c030c814a1a68fca1577c57bbfbc5be (patch)
treeb57d499ac062959f1e801f37888271e320f358b1 /addons/web/static/src/js/fields
parent0164c9dfcb8f94dd09ffc5a0ce056e4e23308abe (diff)
[FIX] mail: accurate message notifications marked as sent
When multiple emails (`mail.mail`) are linked to the same message (`mail.message`), all the message notifications were being marked as sent as soon as one of the mail was sent, and not all of them. This is indeed possible to have multiple emails linked to a single message, for instance when there are employees and customers in the followers of a thread, and some must therefore have the buttons meant for the employees ("Assign me") and some not. In other words, it was possible notifications were marked as sent while their associated email was not sent yet. This revision also comes as an addition to 5d6656d739feff7abb8e191fdc038cc03b542d3b as it was possible to receive a bounce coming from the previous mail sent which wrote on the same notifications `email_status` than the current message being sent before we could acquire the lock on them (see commit message of the above mentioned revision), as it was writing the `email_status` on more notifications that it should have, including notifications of the previous email. e.g - Mail 1 - Message 1 - Recipient A, B, C - Mail 2 - Message 1 - Recipient D, E Let's say recipient A bounces If the email notifying the bounce arrives during the processing of the "Mail 1", it will be blocked until we release the lock on the `mail.notification` `email_status` we acquire thanks to having written `exception` on `email_status` before sending the email. But, as soon as it is unblocked (after the `cr.commit()`), it will immediately re-attempt the delivery of the bounce email, therefore writting "bounced" in `email_status` of recipient A, while the transaction of the second email already began. When the second email sending will try to write the `email_status` of recipient A as well (as it used to write the `email_status` on all the message notifications, not just the one related to the current email), it raised a concurrent update. Therefore: 1. Interrupting the loop, as psycopg2 exceptions are raised and not passed, 2. Replay the sending of the second email a second time. opw-1984293 closes odoo/odoo#33431 Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/src/js/fields')
0 files changed, 0 insertions, 0 deletions