Details
-
Bug
-
Status: Closed (View Workflow)
-
P2
-
Resolution: Done
-
12.0.1
-
-
CP: sprint 94, CP: sprint 95
-
0
-
Core: Platform
-
Q2 2020 Hot Fix #2
-
Chalmers
Description
Overview:
When offset >= totalRecords then no more records are returned, even if there are more (when totalRecords estimation is smaller than actual number of records).
Steps to Reproduce:
Locally run mod-circulation-storage 12.0.1 (this is based on RMB 30.2.4).
Create 2000 open loans:
OKAPI="${OKAPI:-http://localhost:8081}" TOKEN=$( curl -s -S -D - -H "X-Okapi-Tenant: diku" -H "Content-type: application/json" -H "Accept: application/json" \ -d '{"tenant":"diku","username":"diku_admin","password":"admin"}' $OKAPI/authn/login \ | grep -i "^x-okapi-token: " ) OPT=(-w"\n" --http1.1 -s -S -D - -H "$TOKEN" -H "X-Okapi-Tenant: diku" -H "Content-type: application/json" -H "Accept: application/json") for i in `seq 90001 92000` do REQUEST="{ \"id\": \"000${i}-f5be-41ea-8665-5c810246757e\", \"itemId\": \"000${i}-f5be-41ea-8665-5c810246757e\", \"userId\": \"ceecd8ee-9586-4024-b107-d368b58a1025\", \"loanDate\": \"2020-02-02T20:02:02\", \"status\": { \"name\": \"Open\" }, \"action\": \"checkedout\", \"itemStatus\": \"Checked out\" }" curl "${OPT[@]}" -d "$REQUEST" $OKAPI/loan-storage/loans done
GET /loan-storage/loans?offset=999&limit=2&query=status.name=Open
correctly returns 2 records:
{ "loans" : [ { "id" : "00090997-f5be-41ea-8665-5c810246757e", "userId" : "ceecd8ee-9586-4024-b107-d368b58a1025", "itemId" : "00090997-f5be-41ea-8665-5c810246757e", "status" : { "name" : "Open" }, "loanDate" : "2020-02-02T20:02:02", "action" : "checkedout", "itemStatus" : "Checked out", "metadata" : { "createdDate" : "2020-07-27T17:13:38.765+0000", "updatedDate" : "2020-07-27T17:13:38.765+0000" } }, { "id" : "00090998-f5be-41ea-8665-5c810246757e", "userId" : "ceecd8ee-9586-4024-b107-d368b58a1025", "itemId" : "00090998-f5be-41ea-8665-5c810246757e", "status" : { "name" : "Open" }, "loanDate" : "2020-02-02T20:02:02", "action" : "checkedout", "itemStatus" : "Checked out", "metadata" : { "createdDate" : "2020-07-27T17:13:38.782+0000", "updatedDate" : "2020-07-27T17:13:38.782+0000" } } ], "totalRecords" : 1001 }
GET /loan-storage/loans?offset=1000&limit=2&query=status.name=Open
incorrectly returns none:
{ "loans" : [ ], "totalRecords" : 1000 }
TestRail: Results
Attachments
Issue Links
- blocks
-
CIRCSTORE-233 Release mod-circulation-storage 12.0.3
-
- Closed
-
- is blocked by
-
CIRCSTORE-232 Upgrade to raml-module-builder (RMB) 30.2.5
-
- Closed
-
-
RMB-684 GET query returns no records when offset value > estimated totalRecords
-
- Closed
-