Aging Circulations Removes Auto-Renewal Information

Bug #1840669 reported by John Amundson on 2019-08-19
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
High
Unassigned
3.2
High
Unassigned
3.3
High
Unassigned

Bug Description

Evergreen 3.2.4

When circulations are aged, (i.e. anonymized), auto-renewal information is stripped from the circulation.

The fields
auto_renewal
auto_renewal_remaining
are reverting to a NULL state.

This means aged auto-renewals cannot be identified so circulation stats are being thrown off.

At the time of writing this is compounded by the fact that auto-renewals register as both desk and auto-renewals, (see LP Bug #1835085). So for now, auto-renewals are leaving rows in aged_circulation where desk_renewal is TRUE and workstation IS NULL and auto_renewal IS NULL. This is also how self-check renewals are registered for some libraries.

Given that both aging circulations and auto-renewals are turned on in a system, this query can be run to confirm there is no auto-renewal information appearing in the aged_circulation table.

SELECT *
FROM action.aged_circulation
WHERE auto_renewal=TRUE OR auto_renewal_remaining IS NOT NULL

Changed in evergreen:
status: New → Confirmed
Jason Stephenson (jstephenson) wrote :

The action.age_circ_on_delete() trigger function does not copy the auto_renewal and auto_renewal_remaining field values to the action.aged_circulation table. The fix appears to be to make it do so.

Changed in evergreen:
milestone: none → 3.4-beta1
assignee: nobody → Jason Stephenson (jstephenson)
Changed in evergreen:
status: Confirmed → In Progress
Jason Stephenson (jstephenson) wrote :

Branch in user/dyrcona/lp1840669-age-auto_renewals (https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dyrcona/lp1840669-age-auto_renewals).

Testing is relatively simple on production data if you're doing circulation aging and auto-renewals already. Just apply the database upgrade and run the action.purge_circulations database function. Then, then check that some aged circulations now have the auto_renew field set to true instead of all NULL. Results will vary depending on what other patches have been applied (cf. bug 1839002 and bug 1835085), on how many auto-renewed circulations are checked in, and your internal flag settings for circulation aging.

Testing with concerto data is similar, but you will need to configure the settings for circulation aging to some very short interval, set up the auto-renewal action triggers, run the action trigger runner, check in auto renewed circulations, wait an appropriate amount of time, and then run the purge circulations database function.

We have tested this at CW MARS with production data in conjunction with the patch for bug 1835577 so that results could be verified via reports.

Changed in evergreen:
status: In Progress → Confirmed
assignee: Jason Stephenson (jstephenson) → nobody
tags: added: pullrequest
Jason Stephenson (jstephenson) wrote :

Set the importance to High because this is a data loss issue, but I don't think it rises to the level of Critical.

Changed in evergreen:
importance: Undecided → High
Galen Charlton (gmc) on 2019-09-11
Changed in evergreen:
milestone: 3.4-beta1 → 3.4-beta2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers