Repository navigation
fix: send list paging parameters in the JSON body - #38
Merged
Merged
Conversation
The Fess admin list endpoints (Fess 15.8 and 15.9) bind size, page and the per-endpoint filters from the JSON request body of the GET and ignore the query string. fessctl sent them only as query parameters, so `--size` and `--page` never reached the server: every list command returned the server default page (25 rows), and a caller that walked the pages re-read page 1 and missed everything after the first 25 entries. `send_request` now sends the parameters of a list request both as the JSON body and as the query string, so a server that reads either channel works. Single-record lookups are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fessctl <resource> list --size N --page Mhad no effect against Fess 15.8 and 15.9. The admin list endpoints readsize,pageand the endpoint's filters from the JSON body of the GET request and ignore the query string, butFessAPIClient.send_requestonly sentparams=.Observed with
GET /api/admin/<resource>/settingsandsize=1&page=2:So every list command returned the server default of 25 rows. A script that pages with
--page 1,2,...until it hastotalrows (for example a migration helper) read page 1 repeatedly and silently skipped the rest once there were more than 25 entries.Change
Action.LISTrequests now go throughhttpx.request("GET", ..., params=params, json=params): the parameters travel in the JSON body (what the server reads) and stay in the query string (harmless; keeps a server that reads either channel working). One place insend_request, not the 23list_*methods.Action.GET(single record by id) is unchanged.--sizedefault of 100 now actually applies.Fess 14.x was not probed (no image at hand). The client already parses the Fess version if a gate is ever needed.
Tests
tests/unit/test_client.py):TestListPagingasserts that all 23list_*methods putpage/sizeinto the JSON body and the query string, that a list call without parameters sends no body, and that a GET by id sends no body. The new list tests fail on the previous client (25 of 26) and pass now; two existing tests that mockedhttpx.getfor list calls now mockhttpx.request.uv run pytest tests/unit: 155 passed.tests/commands/test_scheduler.py::test_scheduler_list_size_and_page):--size 1returns exactly one row on page 1 and a different row on page 2, withtotalgreater than 1. It failed before the change (15 == 1on 15.9,14 == 1on 15.8.0) and passes on both versions.tests/commandsagainst 15.8.0: 47 passed, 1 skipped (test_tagtype, 15.8.0 has no tagtype API). Against the 15.9 snapshot: 47 passed, 1 failed -test_user_crud_flowat the update step ("roleA is not a registered role or group id"); it fails the same way without this change.