CROSSLINK-302 Clean up supplier NCIP requests - #683
Merged
adamdickmeiss merged 3 commits intoJul 23, 2026
Conversation
Cancel RequestItem before ask-retry, cannot-supply, and accept-cancel when a supplier request exists. Compensate when saving the item after RequestItem fails. Leave CheckOutItem/CheckInItem and manual termination flows unchanged.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the lender-side patron request action flow to proactively cancel NCIP RequestItem holds before sending certain ISO18626 status changes (ask-retry, cannot-supply, accept-cancel) when a supplier-side request exists, and adds compensation logic to cancel the hold if persisting the item fails after RequestItem succeeds.
Changes:
- Pass LMS adapter + ISO18626 request into cannot-supply / ask-retry / accept-cancel handlers and cancel
RequestItemfirst when items exist for the PR. - Add compensation: if
SaveItemfails after a successfulRequestItem, attemptCancelRequestItemand join the error if that compensation fails. - Expand unit tests and test doubles to cover the new cancellation behavior (including a new cannot-supply cancel-failure test).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| broker/patron_request/service/action.go | Cancels supplier-side LMS requests before certain lender actions; adds SaveItem failure compensation with CancelRequestItem. |
| broker/patron_request/service/action_test.go | Updates mocks and tests to account for new CancelRequestItem behavior and adds a cancel-failure test for cannot-supply. |
adamdickmeiss
marked this pull request as draft
July 23, 2026 12:21
adamdickmeiss
marked this pull request as ready for review
July 23, 2026 12:38
jakub-id
approved these changes
Jul 23, 2026
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.
https://index-data.atlassian.net/browse/CROSSLINK-302
Cancel RequestItem before ask-retry, cannot-supply, and accept-cancel when a supplier request exists.
Compensate when saving the item after RequestItem fails.
Leave CheckOutItem/CheckInItem and manual termination flows unchanged.