Overdue and Courtesy notices generated but not sent if loan has been renewed

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:

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

None

Attachments

5

Checklist

hide

TestRail: Results

Activity

Show:

julie.bickleAugust 19, 2021 at 1:49 PM

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

Marie WidigsonAugust 18, 2021 at 12:54 PM

I've tested together with  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...)

julie.bickleAugust 18, 2021 at 6:36 AM

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

Oleksandr VidinieievAugust 16, 2021 at 2:48 PM

I believe I do, thanks.

AnyaAugust 16, 2021 at 2:21 PM

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

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Vega

Fix versions

Release

R2 2021 Bugfix

Affected Institution

Chalmers
Cornell
MO State
Okanagan College

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created August 11, 2021 at 5:27 PM
Updated April 11, 2022 at 11:09 PM
Resolved August 18, 2021 at 1:09 PM
TestRail: Cases
TestRail: Runs