[MODPATRON-131] TLR: Cancelling TLR:s that were created without items returns HTTP 500 Created: 22/Feb/23  Updated: 13/Oct/23  Resolved: 10/Mar/23

Status: Closed
Project: mod-patron
Components: None
Affects versions: None
Fix versions: 5.5.2, 6.0.0

Type: Bug Priority: P3
Reporter: Theodor Tolstoy (One-Group.se) Assignee: Roman Barannyk
Resolution: Done Votes: 0
Labels: support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Attachments: File 2023-03-16_16h28_11.mp4     PNG File screenshot-1.png    
Issue links:
Defines
defines UXPROD-3811 Vega - Orchid Enhancements/Bugfixes/T... Closed
Relates
relates to MODPATRON-132 Release mod-patron - Orchid BugFix Closed
Sprint: EPAM-Veg Sprint 160, EPAM-Veg Sprint 161
Story Points: 3
Development Team: Vega
Release: Orchid (R1 2023) Bug Fix
Affected Institution:
!!!ALL!!!
RCA Group: Implementation coding issue
Affected releases:
Nolana (R3 2022), Morning Glory (R2 2022)

 Description   

Overview:
Steps to Reproduce:

  1. Using the [Patron API|https://s3.amazonaws.com/foliodocs/api/edge-patron/p/edge-patron.html#patron_account__id__instance__instanceid__hold_post,] create a Title-level request for an Instance with a Holding, but with no Items attached
// POST /patron/account/508bab48-3da1-5fa3-b812-12ed7b77db65/instance/7b08b937-c1ac-4c53-b833-e06f1624c54c/hold
"item": {    "instanceId""7b08b937-c1ac-4c53-b833-e06f1624c54c"      },    "requestDate""2023-02-22T08:16:30Z",  "pickupLocationId""a77b55e7-f9f3-40a1-83e0-241bc606a826"} 
  1. Using the same API, cancel the request.
// POST /patron/account/508bab48-3da1-5fa3-b812-12ed7b77db65/hold/42ab72ac-1973-4a13-ab18-c859c1122a65/cancel
{  "holdId" : "42ab72ac-1973-4a13-ab18-c859c1122a65",  "cancellationReasonId" : "4ca6a58e-f8ed-4f7a-89ee-7a3e0f20a659",  "canceledByUserId" : "508bab48-3da1-5fa3-b812-12ed7b77db65",  "cancellationAdditionalInformation" : "I don't need it anymore",  "canceledDate" : "2023-02-22T10:16:30Z",  "pickupLocationId""a77b55e7-f9f3-40a1-83e0-241bc606a826",    "requestDate""2023-02-22T08:16:30Z"} 

Expected Results:

The request is cancelled:

// POST /patron/account/508bab48-3da1-5fa3-b812-12ed7b77db65/hold/e8f2f441-01b5-4ee1-bd33-0f9ead32b701/cancel
{    "requestId""42ab72ac-1973-4a13-ab18-c859c1122a65",    "item": {        "instanceId""7b08b937-c1ac-4c53-b833-e06f1624c54c",        "itemId""e972c4a6-57d2-4fbb-9ec8-0179869cfe41",        "title""Instance without items to test TLR"    },    "requestDate""2023-02-22T08:16:30.000+00:00",    "status""Closed - Cancelled",    "pickupLocationId""a77b55e7-f9f3-40a1-83e0-241bc606a826",    "queuePosition": 1,    "cancellationReasonId""4ca6a58e-f8ed-4f7a-89ee-7a3e0f20a659",    "canceledByUserId""508bab48-3da1-5fa3-b812-12ed7b77db65",    "cancellationAdditionalInformation""I don't need it anymore",    "canceledDate""2023-02-22T10:16:30.000+00:00"} 

Actual Results:

// POST /patron/account/508bab48-3da1-5fa3-b812-12ed7b77db65/hold/e8f2f441-01b5-4ee1-bd33-0f9ead32b701/cancel
HTTP 500 Internal Server Error.
If the issue persists, please report it to EBSCO Connect. 

 
Additional Information:
Adding an item after the request was created also renders HTTP 500. If there is an item at the time for the request, the API works as expected.
This HTTP 500 in mod-patron makes the edge-patron call also raise a HTTP 500, which makes the Discovery user experience hard to handle.
Interested parties:

All libraries with a discovery tool/OPAC that allows you to make TLRs on things without Items, All libraries wanting to post requests for things without holdings. Not an uncommon practice when you want to order specific issues of journals. Not sure how common it is for FOLIO libraries. Having Instances without Items is very common though.

Verified in both live Morning Glory environments and in Nolana.



 Comments   
Comment by Lisa Sjögren [ 22/Feb/23 ]

I wonder if creating requests on instances without items has been fully implemented? There is an open issue called "Create and retrieve a Title Level Request for an instance without any items associated with it". https://folio-org.atlassian.net/browse/CIRC-266

Comment by Theodor Tolstoy (One-Group.se) [ 22/Feb/23 ]

I would say this issue verifies that it has not been fully implemented. However, finding that out at the time of cancellation seems a little late, and has been causing some issues in EDS. I believe EDGE-PATRON requests also return HTTP 500, which clearly signals that the issue is on the FOLIO side.

Comment by Anya [ 28/Feb/23 ]

Support: Stephanie Buck - awareness  and someone should groom it to see if it is a Bug or a New Feature.

Comment by Lisa Sjögren [ 03/Mar/23 ]

Looking at some other reported cases where request cancellations from EDS have failed, I wonder if this problem (or some variation of it) might extend to any TLR where the request hasn't yet been associated with an item – whether that is because there is no item linked to the instance, or because all existing items are checked out, or because the request is a hold and all existing items have status "Available".

Comment by Roman Barannyk [ 08/Mar/23 ]

The fix was deployed and verified on snapshot, it works as expected:

Comment by Roman Barannyk [ 09/Mar/23 ]

Theodor Tolstoy (One-Group.se), could you test the fix and close this ticket if everything is OK?

Comment by JenkinsNotifications [ 14/Mar/23 ]

Deployed to Orchid bf env. Moved status to In bugfix review from status Awaiting deployment. Please proceed with verification

Comment by Roman Barannyk [ 16/Mar/23 ]

Verified on orchid bugfest: 2023-03-16_16h28_11.mp4

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