Bug 12396

Summary: MTT FIX: Due notices (DUEDGST) are multiplicated and everybodys all ODUEDGST are sent to everyone who should receive them.
Product: Koha Reporter: Olli-Antti Kivilahti <olli-antti.kivilahti>
Component: NoticesAssignee: Olli-Antti Kivilahti <olli-antti.kivilahti>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: critical    
Priority: P5 - low CC: bgkriegel, fridolin.somers, gmcharlt, jonathan.druart, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12315
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 10833    
Bug Blocks:    
Attachments: solution
[SIGNED-OFF] Bug 12396 - MTT FIX: Due notices (DUEDGST) are multiplicated and all of them are sent to everybody who is about to receive ODUEDGST.
Bug 12396 - MTT FIX: Due notices (DUEDGST) are multiplicated and all of them are sent to everybody who is about to receive ODUEDGST.

Description Olli-Antti Kivilahti 2014-06-10 06:56:04 UTC
So the first patron receives correct letters, but the followings received
all the previous ones AND his letters.
Eventually you end up with !n letters in message_queue where n = amount of patrons receiving due messages as digest and having something due.

Eventually we got 4 000 000 ODUEDGST-letters of which 1 100 000 were sent to our patrons :)
This is madness!

Test plan:
0/ Delete the content of the message_queue table.
1/ Pick 3 patrons and set them to receive due messages as digest.
2/ Check 1 item out for 3 separate patrons and specify a due date today.
3/ Launch the advance_notices.pl script.
4/ Before this patch, you got 6 notices (1+2+3 [!n]). Now, you get 3 notices, 1 for each patron.
Comment 1 Olli-Antti Kivilahti 2014-06-10 07:06:11 UTC Comment hidden (obsolete)
Comment 2 Bernardo Gonzalez Kriegel 2014-06-10 12:12:12 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2014-06-10 14:08:08 UTC
Created attachment 28760 [details] [review]
Bug 12396 - MTT FIX: Due notices (DUEDGST) are multiplicated and all of them are sent to everybody who is about to receive ODUEDGST.

So the first patron receives correct letters, but the followings received
all the previous ones AND his letters.
Eventually you end up with !n letters in message_queue where n = amount of patrons
receiving due messages as digest and having something due.

Eventually we got 4 000 000 ODUEDGST-letters of which 1 100 000 were sent to our patrons :)
This is madness!

Test plan:
0/ Delete the content of the message_queue table.
1/ Pick 3 patrons and set them to receive due messages as digest.
2/ Check 1 item out for 3 separate patrons and specify a due date today.
3/ Launch the advance_notices.pl script.
4/ Before this patch, you got 6 notices (1+2+3 [!n]). Now, you get 3 notices, 1 for each patron.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Problem exis.
Patch work as described following test plan.
No koha-qa errors

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 4 Jonathan Druart 2014-06-10 14:08:52 UTC
Same silly error as in bug 12315...
Comment 5 Jonathan Druart 2014-06-10 14:25:15 UTC
This is not blocker but definitely critical.
Comment 6 Tomás Cohen Arazi (tcohen) 2014-06-15 14:18:08 UTC
Patch pushed to master.

Thanks Olli!
Comment 7 Galen Charlton 2014-06-18 21:12:44 UTC
Pushed to 3.16.x for inclusion in 3.16.1.
Comment 8 Fridolin Somers 2014-12-15 16:37:06 UTC
Depends on Bug 10833, not in 3.14, so I set has resolved