https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383

Martin Renvoize (ashimema) <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Passed QA                   |Failed QA

--- Comment #202 from Martin Renvoize (ashimema) 
<[email protected]> ---
QA re-review of the whole chain (43486, 42425, 24401, 43077 and this bug: 79
patches) applied on current main, with the Perl tests run in KTD. Review was
done with Claude assistance; items I reproduced or confirmed against legacy
code are marked, the rest are from reading the code and tests. I don't think
Passed QA holds yet, so I am moving this back to Failed QA. Findings on the
dependencies are on their own bugs.

REBASE (the series was built on main of 2026-11-02; main has moved 232 commits)
- Patch "Make returning error responses opt-in in HttpClient" conflicts with
Bug 43516 (pushed 2026-11-03), which added a config argument
(suppressDefaultErrorDialog, signal) to HttpClient. The two mechanisms now
overlap: 43516 throws with the status and code attached, return_error_response
hands back the raw Response, and _fetchJSON has seven positional parameters.
Suggest extending the 43516 path to attach the parsed body to the error, use
suppressDefaultErrorDialog in checkin-api-client.js, catch on err.status (412,
403), and drop return_error_response.
- 42425 needs rebasing over Bug 43504, see there.

BACKEND (legacy parity against circ/returns.pl and AddReturn)
1. (confirmed) The step that cancels a waiting hold which has a cancellation
request, before the return (returns.pl line 366,
filter_by_has_cancellation_requests), is not ported. Nothing in Koha::Checkin,
the controller or C4::Circulation calls it, so such a hold stays waiting.
2. Blocked check-ins (withdrawn, lost, wrong branch) return 403 before
AddReturn, so no checkins row is written and no local use is recorded
(RecordLocalUseOnReturn); the BlockedLost side effects are skipped as well.
Not-issued items return 412 before anything is recorded.
3. Cancelling a hold no longer re-runs CheckReserves, so staff are not told
that the next hold is at another branch (returns.pl lines 133 to 146).
4. confirm_recall ignores whether transferbook actually started a transfer and
returns 201 (legacy had the same flaw, but the API now reports success).
5. Follow-up actions (transfer, recall) only check is_latest. If the item is
checked out again without a new check-in they still pass, and cancel_transfer
can set datecancelled on a transfer that has already arrived.
6. POST /checkins returns 200 even when AddReturn did not return the item (the
DataCorrupted path), still runs the follow-ups, and the data_corrupted payload
carries the raw exception text.
7. The multi-step controller sequence (AddReturn, then replace_wrong_transfer,
confirm_hold, verify_bundle) is not atomic; a failure in a later step leaves
the return committed and a retry records a second check-in.
8. Library scope: library_id comes from the request body without validation,
see 24401.
9. Minor: Koha::Module::Policy::Checkin documents a library context it never
reads; the waiting-holds notice uses the staff branch rather than the check-in
library; reason on hold_cancellation is not validated against the authorised
value list.
10. Not part of this bug, but worth its own bug: ReturnClaims resolve (Bug
28271) trusts a client-supplied resolved_by.

FRONT END
11. Stale index in the checkin store: confirmPending, resolveAction and
cancelHoldGroup capture idx = checkins.value.indexOf(entry) before an await and
write checkins.value[idx] afterwards, while _addEntry uses unshift. Only the
same barcode is guarded, so a different scan during a confirmation shifts every
index and the confirmation overwrites another row (read in stores/checkin.js;
not reproduced in a browser).
12. _addEntry trims the list to numReturnedItemsToShow (default 8) without
regard to pending or action-needed rows, so a row awaiting confirmation can be
evicted and its confirmation then fails with "Entry not found".
13. The non-blocking transfer prompt resolves on any document click, since
there is no backdrop, and Main.vue then cancels the transfer or confirms it
when AutomaticConfirmTransfer is on. Legacy used a backdrop.
14. "Remove from bundle" uses a raw fetch DELETE with no CSRF-TOKEN header. The
CSRF plugin guards unsafe methods for session-cookie requests, so this will
very likely get a 403. It should go through APIClient and HttpClient.
15. (confirmed against main) The ILL "Check-in" action used to POST a form that
checked the item in; it now only navigates to checkin.pl?barcode=, which
prefills the page, so staff must check in again.
16. Follow-up actions have no in-flight guard (double-click or repeated
shortcut sends two POSTs with the same token), and error handling is
inconsistent: a 5xx or non-JSON response shows "Network error", network
failures show two messages, 409 bodies show raw English, and a 401 has no login
path.
17. Other parity or UX gaps: no CSV, copy or print buttons on the session
table; a cancelled bundle verification leaves the item stranded; a duplicate
scan is dropped without feedback; the return date is cleared before the outcome
is known; scanning is no longer blocked while hold or recall modals are open
(intended?).
18. Accessibility and translation: placeholder-only inputs, icon-only controls,
no focus management or aria-labelledby on the modals, results not announced;
HTML inside translatable strings combined with String.replace (which mangles
$-sequences), a hard-coded English "Remove from bundle" inside a translatable
string, and patron_has_fines and patron_has_waiting_holds have no label.

TESTS
19. The Cypress spec has 13 tests but no coverage of the 412 confirmation flow,
bundle verification or removal, error responses, concurrent scans or double
submits. basic_workflow.t needs a Selenium server, so I could not run it in
KTD.

HISTORY
20. 61 commits including many QA follow-ups that revise earlier patches (the
HttpClient one is an example). Please squash before this goes in.

Verified in KTD: t/db_dependent/api/v1/checkins.t, Checkin.t,
Item/Availability/Checkin.t, Module/Policy*.t, Patrons.t and koha-qa.pl file
checks pass; Circulation.t fails only on the 42425 forgive-path assertion.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to