[CIRC-1205] Overdue and Courtesy notices generated but not sent if loan has been renewed Created: 11/Aug/21  Updated: 11/Apr/22  Resolved: 18/Aug/21

Status: Closed
Project: mod-circulation
Components: None
Affects versions: None
Fix versions: 22.0.4, 22.1.0

Type: Bug Priority: P1
Reporter: Lisa Sjögren Assignee: Oleksandr Vidinieiev
Resolution: Done Votes: 0
Labels: iris_release, patron_notice, support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Attachments: PNG File MicrosoftTeams-image (1).png     PNG File SUP-47_CircLog.PNG     PNG File SUP-47_LoanDetails.PNG     PNG File image-2021-08-12-16-08-10-822.png     PNG File image-2021-08-13-12-46-25-530.png    
Issue links:
Defines
defines CIRC-1206 Release 22.0.4 Closed
Relates
relates to CIRC-1051 Stop sending overdue notices and/or a... Closed
relates to CIRC-1513 Stop sending loan notices with trigge... Closed
Sprint: EPAM-Veg Sprint 121
Story Points: 3
Development Team: Vega
Release: R2 2021 Bugfix
Affected Institution:
Chalmers, Cornell, MO State, Okanagan College

 Description   

Overview: When a loan has been renewed, Overdue and Courtesy (due date-triggered) notices are generated, and eventually cleared, from scheduled-notice-storage, but not sent as emails to the user.
Update from Julie: Only affects due date-triggered emails, ie. Aged to Lost is not affected.

Preconditions:
Circulation rules are configured to send overdue notices. For the sake of testing, I am using a loan policy with a short loan period, and a notice policy with one-time overdue notices configured to be sent in real-time throughout the day.

Chalmers however reported this with long loans and overnight notices as well, affecting Overdue and Courtesy notices. It occurs when a loan has been renewed.

Steps to Reproduce:

  1. Check out item A with a short loan period to yourself
  2. Verify in scheduled-notice-storage that an overdue notice has been generated for the loan, with nextSendDate based on the loan's due date. Yes!
  3. Wait for the loan to expire, and until you've received the overdue notice
  4. Verify that you've received the notice email. Yes!
  5. Check out item B with a short loan period to yourself
  6. Verify in scheduled-notice-storage that an overdue notice has been generated for the loan, with nextSendDate based on the loan's due date. Yes!
  7. Renew the loan.
  8. Verify in scheduled-notice-storage that an overdue notice has been generated for the loan, with nextSendDate based on the loan's new due date. Yes!
  9. Wait for the loan to expire, and until you've received the overdue notice

Expected Results:
You receive a notice email.

Actual Results:
You wait and wait, well past the nextRunTime of the notice in scheduled-notice-storage, but receive no notice email. Eventually the notice disappears from notice in scheduled-notice-storage – but you receive no email, and if you make a call to mod-email there is no sign of one having been sent.

Additional Information:
To try to pinpoint the issue, I performed the following additional steps:

  1. Make a GET request to loan-storage/loans to fetch the renewed loan (item B)
  2. In the returned loan object, change the action from "action": "renewed" to "action": "dueDateChanged"
  3. PUT the edited loan object back to loan-storage
  4. Verify in scheduled-notice-storage that an overdue notice has been generated for the loan, with nextSendDate based on the loan's due date (which is the same as after the renewal). Yes!
  5. Wait for the loan to expire, and until you've received the overdue notice
  6. Verify that you've received the notice email. Yes!

URL: https://folio-iris.dev.folio.org/
Interested parties: Marie Widigson Johanna Nilsson



 Comments   
Comment by Lisa Sjögren [ 11/Aug/21 ]

Hi julie.bickle!

Chalmers reported that, since the upgrade to Iris, their users have not been receiving overdue or courtesy notices for loans that have been renewed. I was able to reproduce this behaviour in https://folio-iris.dev.folio.org/.

Comment by Brooks Travis [ 12/Aug/21 ]

This is happening at MO State, as well. The notifications are being cleared, but no email. Another interesting note: recurring notices are not being re-scheduled, either. For my testing policies, I have recurring courtesy and overdue notices set, and they're also disappearing from the scheduled notices at their next runtime, rather than having their next runtime updated.

Comment by Brooks Travis [ 12/Aug/21 ]

Lisa Sjögren Marie Widigson Have we verified this with loans and notice periods based on days (or longer), or are we only seeing it for really short-term loans?

Comment by julie.bickle [ 12/Aug/21 ]

Alexander Kurash Lisa's done a great job of describing the issue above.

Of particular interest is point 2. in Additional Information; that seems to indicate that loan action status = renewed is part of why the reminder + overdue emails don't get sent out. 

Is there anything else you/the team need?

PS: I'm preparing some test cases for this.

Comment by Brooks Travis [ 12/Aug/21 ]

julie.bickle Lisa Sjögren This may not have anything to do with this issue, but I'm also seeing some weird behavior in our production environment when attempting to fetch emails from /email via postman. Every few requests, I'm getting a permission error telling me I don't have the correct permissions. It's the same user and API token every time, so it seems like there might be some permission issues around mod-email..

Comment by julie.bickle [ 12/Aug/21 ]

Lisa Sjögren you mention that Reminder + Overdue emails aren't getting sent; what about Aged to Lost emails?

Comment by Brooks Travis [ 12/Aug/21 ]

Are there any objections to marking this as a P1 (no workarounds, potential for significant operational impact)? And do we know if it is present in Juniper, as well?

Comment by Lisa Sjögren [ 12/Aug/21 ]

Brooks Travis, thanks for confirming MO State are also affected!

Marie Widigson and Johanna Nilsson may give more details, but as I understand from Chalmers's original report, the Aged to lost notices do get sent. Affecting short and long loans.

Comment by julie.bickle [ 12/Aug/21 ]

I can replicate in Snapshot.

After renewing, it feels like the loan is stuck in Renewal, and nothing else happens. As the Item status doesn't seem to update, it doesn't go to Overdue, so I have also not received the Aged to Lost. Used wrong config, I'm testing again.

SUP-47_LoanDetails
SUP-47_CircLog

Comment by Marie Widigson [ 12/Aug/21 ]

We discovered the issue with our standard loans (days), then tested with minutes. Is affecting all policies yet tested. Aged to lost-mails are sent out.
Would very much appreciate highest priority!

Comment by julie.bickle [ 12/Aug/21 ]

Marie Widigson What's your logic for sending out Aged to Lost? (I don't seem to be getting them, so wanna check your configuration)

Comment by Marie Widigson [ 12/Aug/21 ]

Hi julie.bickle
We have been using Aged to lost for the first time this week to catch up old overdue loans. This was actually how we was made aware of this bug. Here you can see that after the Renew email, no other e-mail has been sent until the Aged to lost. (Pre Iris upgrade on the 7th of July, also courtesy notes was sent after renewals.)

We've not actively tested with Aged to lost policy yet, will do that later today or tomorrow.

Comment by Alexander Kurash [ 12/Aug/21 ]

julie.bickle No additional info needed right now, thanks. We're trying to reproduce this issue and find the root cause.

Comment by Marie Widigson [ 13/Aug/21 ]

Have now tested Aged to lost after having renewed. I've got the e-mail two times out of three tests, using the same settings and policy. (The item got Aged to lost as it should also in the case when no e-mail was sent out, which was confirmed in both Circ log and Postman e-mail API.) A bit confused about that, perhaps this needs more testing? julie.bickle

This is the example where I could find no e-mail.

Comment by Marie Widigson [ 13/Aug/21 ]

Just a thought. Is this issue occuring also in the environment where https://folio-org.atlassian.net/browse/CIRC-1165 is solved?

Comment by Oleksandr Vidinieiev [ 13/Aug/21 ]

Lisa Sjögren, Brooks Travis, julie.bickle, Marie Widigson

CIRC-1051 Closed introduced a list of events/statuses which should stop sending of recurring loan-related notices. Note that loan renewal is on this list for both overdue and aged-to-lost notices.

Unfortunately, while looking at our code I saw that CIRC-1051 Closed was implemented incorrectly and all the conditions listed for overdue notices were applied to ALL due-date-triggered notices. This is a bug that needs to be addressed, but in this particular case it is irrelevant since Lisa Sjögren faced an issue with overdue notices.

I would kindly ask all interested parties to review the list of conditions outlined in CIRC-1051 Closed and see if they are correct.

Comment by Brooks Travis [ 13/Aug/21 ]

Oleksandr Vidinieiev Aren't overdue notices due date triggered notices?

Comment by Oleksandr Vidinieiev [ 16/Aug/21 ]

Brooks Travis Yes, they are. What I meant is that Lisa wouldn't have received her overdue notice even if CIRC-1051 Closed had been implemented correctly, since its requirements state that renewal should stop recurring overdue notices.

Comment by Lisa Sjögren [ 16/Aug/21 ]

Hi! The overdue notice I mention above was a one-time notice, not recurring. Will clarify in the description.

Comment by Oleksandr Vidinieiev [ 16/Aug/21 ]

Lisa Sjögren thanks for clarification!

Comment by Anya [ 16/Aug/21 ]

Support: Oleksandr Vidinieiev do you have what you need to run with this? Thanks 

Comment by Oleksandr Vidinieiev [ 16/Aug/21 ]

Anya I believe I do, thanks.

Comment by julie.bickle [ 18/Aug/21 ]

Lisa Sjögren Oleksandr Vidinieiev

In Snapshot, I have been able to renew an item and then receive courtesy and overdue emails for that item (User = Julie_Student).
Marie Widigson would you be able to try it out and confirm that your work flows also work properly?

Comment by Marie Widigson [ 18/Aug/21 ]

I've tested together with Oleksandr Vidinieiev and it all seems to work fine in https://folio-snapshot.dev.folio.org/ also with settings similar to the ones we use at Chalmers. Great!

(Now we only have to find a way to get those notices out while waiting for Juniper...)

Comment by julie.bickle [ 19/Aug/21 ]

I confirm that we could reproduce the fix in Juniper Bugfest. 

Generated at Thu Feb 08 22:21:53 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.