Hold pickup lib change - Retargeting excludes current (best?) copy

Bug #1866667 reported by Jeremiah Miller
42
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.6
Fix Released
Medium
Unassigned

Bug Description

Evergreen 3.4.2, OpenSRF 3.2.0, PostgreSQL 9.6 on Debian Buster (db is on Stretch).

When patron edits a hold and chooses a different pickup library, the hold retargets. This retarget appears to be the same as a staff-initiated "find another copy", and excludes the current copy.

Even if the originally targeted copy is still by far the best choice to fill the hold.

Even if all of the other copies are non-local, require crossing soft boundaries, etc.

Even if the new pickup location is actually *closer* to the originally targeted copy than the original pickup location was.

Even if the new pickup location is the *home* of the originally targeted copy.

Not theoretical, this just happened to one of our patrons. They placed a hold for System A, for pickup at Branch B. An available copy at System A, Branch A was immediately targeted. Appx two minutes later the patron changed their pickup location to System A, Branch A.

The system let go of the copy at System A, Branch A, and targeted a copy at System B, Branch A instead. Different system, crossing a soft boundary, ignoring the soft stalling interval, etc. Different town, 20 minute drive away, with a courier that only runs here twice a week.

While the best copy for the hold was already right there at the pickup library, on the shelf. Of course the patron happened to find it there when they came in to pickup something else, and had some (reasonable) comments to share on the matter.

Shouldn't a pickup library change be a "retarget everything again" event, rather than a forced "find another copy"?

tags: added: holds
Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Jeremiah, thanks for this bug report. I just tried this out on a 3.3.4 system and can confirm your findings.

I don't think this situation comes up all that often, since the automatic hold pickup selection works for most holds placed. But there must be a situation where it fails, because the alphabetically first pickup location in our list does get several holds a month where that wasn't the intended selection, it just happened to be the default for that one hold.

The new hold targeter does have a soft retarget option, which doesn't exclude the current copy as an option, and keeps that copy as a valid choice.

So it may be as simple as calling the specific retarget call with the soft interval set to 1 second. But that may not work in all cases, I think the soft retarget exits if the current copy is still valid. So in the case where changing the pickup library should cause a different copy to be chosen, that wouldn't work.

It seems like there may need to be another mode for the retargeter, a refresh mode.

I wonder if clearing the current_copy before calling retarget would be enough?

https://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm;hb=f60f0562450569c2e46b1187392dbfede35faf79#l961

There is logic there to handle changing the pickup lib for copies that are in transit or on the hold shelf.

It may make sense to add some logic looking for a pickup_lib change, where the status is waiting for copy, that clears the target_copy. A pickup lib change looks like it always triggers a retarget, unless the item is already captured. I'm not sure if the prev_check_time also needs to be cleared.

For libraries that use the hold target loops feature... I'm not sure that this would work out, but I'm not sure that any retarget tries to handle that in a special way. Hold target loops is a feature that lets a hold cycle through targeting copies at all available copy locations a certain number of times. I believe that a retarget will always try and target a copy at the next location in that mode, but maybe there is an exception for copies at the pickup lib.

Josh

Changed in evergreen:
status: New → Confirmed
Revision history for this message
Jeremiah Miller (jeremym-t) wrote :

A quick note on this...

>I don't think this situation comes up all that often, since the automatic hold pickup selection works for most holds placed. But there must be a situation where it fails, because the alphabetically first pickup location in our list does get several holds a month where that wasn't the intended selection, it just happened to be the default for that one hold.

Whether or not this comes up often may depend on the geographic spread of a given library system. If all branches are rather far apart, the likelihood of a patron simply changing their mind about where to pick it up might be small.

But for us, we have two branches in close enough proximity that it is not rare at all for patrons to choose or change a pickup library based on whichever seems more convenient to them at the time. (We even have patrons that will seek out which branch copies belong to, and change to that, just to get their hands on it a tiny bit quicker.) So even though the automatic pickup selection works well, there will be those that find reason to go back and change it. :)

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Hello Jeremiah, I shouldn't have made that general statement, that is just what I have observed with our Evergreen system. Thanks for giving more details about your situation.

I tried adding in some logic that resets the current_copy when the pickup lib is changed and the status is waiting for capture, and that does seem to fix it.

Here is a working branch with that change. It isn't necessary to clear the prev_check_time, that isn't used when a specific hold is retargeted.

user/stompro/lp1866667_hold_pickup_loc_change_retarget
https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/stompro/lp1866667_hold_pickup_loc_change_retarget

The web staff client and the opac seem to use the same api for updating holds, so this fixes the issue in both places.

Josh

tags: added: pullrequest
Changed in evergreen:
milestone: none → 3.6.1
Changed in evergreen:
milestone: 3.6.1 → 3.6.2
Changed in evergreen:
milestone: 3.6.2 → 3.6.3
Revision history for this message
Dawn Dale (ddale) wrote :

I have tested this code and consent to signing off on it with my name, Dawn Dale and my email address, <email address hidden>.

tags: added: signedoff
Changed in evergreen:
milestone: 3.6.3 → 3.6.4
Changed in evergreen:
milestone: 3.6.4 → 3.7.2
Galen Charlton (gmc)
Changed in evergreen:
importance: Undecided → Medium
Revision history for this message
Bill Erickson (berick) wrote :

Merged to 3.6 and up. Thanks, All!

Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
assignee: Bill Erickson (berick) → nobody
status: Confirmed → Fix Committed
Dan Briem (dbriem)
tags: added: circ-holds
removed: holds
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.